Froggy’s class plans a hiking for their graduation trip. They decide to stay in the Green Mountains for 2 days. Froggy has a map with n-by-m grids on it. Each grid indicates 1 acre with its height noted. However, some of Froggy’s classmates have altitude sickness. Given each classmate’s maximum altitude that they can endure, please calculate how many acres they can stay safely for the trip.
The first line consists of 3 space-separated integers n, m and q. n and m indicate the size of the map, and q is the number of queries. The following n lines contain m space-separated integers each, the j th element in the i th line aij is the altitude of the grid cell on the intersection of the i th row and the j th column. For next q lines, each line is a query with one integer h indicating the maximum height that a Froggy’s classmate’s maximum altitude that they can endure.
For each query, please output the area (in acres) that the classmate can stay safely.
Technical Specification
• 1 ≤ n × m ≤ 105
• 1 ≤ q ≤ 105
• 1 ≤ aij ≤ 1018
• 1 ≤ h ≤ 1018
3 5 4 4 2 5 1 8 1 4 2 8 9 9 9 2 3 5 1 3 6 8
2 6 10 12
Note: acre is a unit of area.
ID | User | Problem | Subject | Hit | Post Date |
沒有發現任何「解題報告」 |