Spreading Fire (Intuit India)
Updated
Problem statement
There is a 2D plane of size N*M. There is fire which is there at K different points in the 2D plane. From each of these K points, the fire is spreading in a circular form with the radius of the fire increasing by time. So, if at t=1, the radius of fire (represented by R) was 2, at t=2, it becomes 4, at t=3, it become 6 and so on. "t" denotes time here. Help us determine, the number of points (points are denoted by (x,y), where both x and y are whole numbers, and are within the plane) which would not be touched by the fire.
Input Format
The first line has 3 space separated integer N, M and K, dimensions of the 2D plane and the number of fire points.
Next K lines each having 2 space separated integers, stating the coordinates of the fire.
Next line denotes the R, the radius of the fire at t=1,
Next line contain an integer T, stating the time at which we want to know points not touched by fire.
Function
countSafePoints(N: int, M: int, K: int, firePoints: int[][], R: int, T: int) → intExamples
Example 1
N = 4M = 4K = 2firePoints = [[1, 1], [3, 3]]R = 1T = 2return = 6Fire does not reach these 6 points:
- 0,3
- 0,4
- 1,4
- 3,0
- 4,0
- 4,1
Constraints
1 <= N <= 10001 <= M <= 10001 <= K <= 51 <= R <= 101 <= T <= 100
More Intuit interview questions
- Number of IslandsONSITE INTERVIEW · Seen Nov 2026
- VIP and Regular Service SchedulerPHONE SCREEN · Seen Nov 2026
- Employee Promotion OpportunitiesOA · Seen Oct 2026
- Next Pascal Row CoefficientOA · Seen Oct 2026
- Parse Router LogsOA · Seen Oct 2026
- Longest Repeated Letter Block with Adjacent SwapsOA · Seen Oct 2026
- Maximum Square-Free DivisorOA · Seen Oct 2026
- Two Tribes from Taller-Person CountsOA · Seen Oct 2026
- Shortest Path from an Encoded GraphOA · Seen Sep 2026
- Oldest and Youngest EmployeesOA · Seen Sep 2026
Similar questions at other companies
- Request Routing SystemStripe · OAStripe interview questions
- HTTP Request RedirectionAmazon · OA
- Rectangle Fit QueriesZipRecruiter · OAZipRecruiter interview questions
- Three Points in a Semicircle: Monte Carlo EstimateSquarepoint Capital · PHONE SCREENSquarepoint Capital interview questions
- Light Source Hits: Sample, Compare, and FitOpenAI · PHONE SCREENOpenAI interview questions
- Rasterize a Circle with Integer PixelsPure Storage · ONSITE INTERVIEWPure Storage interview questions
- Streamed Planar Item TripletsGoogle · ONSITE INTERVIEWGoogle interview questions
- Overlapping Random Time WindowsSusquehanna International Group (SIG) · OASusquehanna International Group (SIG) interview questions
- Theme Park Shuttle Wait TimeAirbnb · OAAirbnb interview questions
- Macaron Order with Set DiscountsShopify · OAShopify interview questions