2.14号英语翻译


题目来源:http://noi.openjudge.cn/ch0201/1661/

重点词汇:

rectangular:adj.矩形的;

pillbox:n.地堡;

bomb:n.炸弹. v.轰炸;

diameter:n.直径;

parallel:adj.平行的.

1661:Bomb Game

  • 查看
  • 提交
  • 统计
  • 提问
总时间限制: 
1000ms
 
内存限制: 
65536kB
描述
Bosko and Susko are playing an interesting game on a board made of rectangular fields arranged in A rows and B columns.
When the game starts, Susko puts its virtual pillbox in one field one the board. Then Bosko selects fields on which he will throw his virtual bombs. After each bomb, Susko will tell Bosko whether his pillbox is in the range of this bomb or not.
The range of a bomb with diameter P (P is always odd), which is thrown in field (R, S), is a square area. The center of the square is in the field (R, S), and the side of the square is parallel to the sides of the board and with length P.
After some bombs have been thrown, Bosko should find out the position of Susko's pillbox. However, the position may be not unique, and your job is to help Bosko to calculate the number of possible positions.

Bosko 和 Susko 正在一块由 A 行 B 列排列的矩形区域组成的棋盘上玩一个有趣的游戏。
游戏开始时,Susko 将其虚拟碉堡放置在棋盘的一个区域中。然后博斯科选择他将在其上投掷虚拟炸弹的领域。每次炸弹后,苏斯科都会告诉博斯科他的碉堡是否在这枚炸弹的射程内。
直径为 P(P 始终为奇数)的炸弹投掷到场 (R, S) 的射程是一个正方形区域。正方形的中心在场(R,S)中,正方形的边与棋盘的边平行,长度为P。
在投掷了一些炸弹之后,博斯科应该找出苏斯科碉堡的位置。但是,职位可能不是唯一的,您的工作是帮助 Bosko 计算可能职位的数量。

输入
First line of input contains three integers: A, B and K, 1 <= A, B, K <=100. A represents the number of rows, B the number of columns and K the number of thrown bombs.
Each of the next K lines contains integers R, S, P and T, describing a bomb thrown in the field at R-th row and S-th column with diameter P, 1 <= R <= A, 1 <= S <= B, 1 <= P <= 99, P is odd. If the pillbox is in the range of this bomb, T equals to 1; otherwise it is 0.

输入的第一行包含三个整数:A、B 和 K,1 <= A、B、K <=100。 A代表行数,B代表列数,K代表投掷炸弹的数量。

接下来的 K 行中的每一行都包含整数 R、S、P 和 T,描述了在第 R 行和第 S 列投掷的炸弹,直径为 P,1 <= R <= A,1 <= S < = B,1 <= P <= 99,P 是奇数。如果碉堡在这颗炸弹的射程内,T等于1;否则为0。

输出
Output the number of possible fields, which Susko's pillbox may stay in.
输出 Susko 的碉堡可能停留的可能字段的数量。
样例输入
5 5 3
3 3 3 1
3 4 1 0
3 4 3 1
样例输出
5
来源
Croatia OI 2002 National – Juniors

相关