four friends

四个朋友在医院等待他们的孩子出生,护士依次告诉他们各自的孩子数量:双胞胎、三胞胎、两对双胞胎,这让前三个人感到惊讶,因为他们分别与明尼苏达双子队、3M公司和四季酒店有关联。然而,第四个人得知消息后却非常沮丧,因为他来自七喜公司。

四个好朋友在医院里碰面了,他们的妻子正在生产.护士过来对第一个男人说:"恭喜,你得了双胞胎."男人说:"多奇怪呀,我是明尼苏达双子队的经理."过了一会儿,护士过来对第二个男人说:"恭喜,你得了三胞胎."男人很喜欢:"嗯,又巧了.我是3M公司的董事."最后,护士跑来对第三个男人说:"恭喜,你得了2对双胞胎."男人很开心地说:"真令人啼笑皆非,我为四季宾馆工作."他们三个都很高兴,但第四个伙伴急得像热锅上的蚂蚁,咒骂上帝并用头撞墙.他们问他有什么不对劲,他回答道:"什么不对劲?我可是在七喜公司工作呀!" 
 
 Four best friends met at the hospital since their wives were giving births to their babies. The nurse comes up to the first man and says, "Congratulations, you got twins." The man said "How strange, I'm the manager of Minnesota Twins." After awhile the nurse comes up to the second man and says, "Congratulations, you got triplets." Man was like "Hmmm, strange I worked as a director for the "3 musketeers." Finally, the nurse comes up to the third man and says 

"Congratulations, you got twins x2." Man is happy and says, "Ironic, I work for the hotel "4 Seasons." All three of them are happy until they see their last buddy jumping all over the place, cursing God and banging his head on the wall. They asked him what's wrong and he answered, "What's wrong? I work for 7up"! 


 

Robert is a famous engineer. One day he was given a task by his boss. The background of the task was the following: Given a map consisting of square blocks. There were three kinds of blocks: Wall, Grass, and Empty. His boss wanted to place as many robots as possible in the map. Each robot held a laser weapon which could shoot to four directions (north, east, south, west) simultaneously. A robot had to stay at the block where it was initially placed all the time and to keep firing all the time. The laser beams certainly could pass the grid of Grass, but could not pass the grid of Wall. A robot could only be placed in an Empty block. Surely the boss would not want to see one robot hurting another. In other words, two robots must not be placed in one line (horizontally or vertically) unless there is a Wall between them. Now that you are such a smart programmer and one of Robert's best friends, He is asking you to help him solving this problem. That is, given the description of a map, compute the maximum number of robots that can be placed in the map. Input The first line contains an integer T (<= 11) which is the number of test cases. For each test case, the first line contains two integers m and n (1<= m, n <=50) which are the row and column sizes of the map. Then m lines follow, each contains n characters of '#', '', or 'o' which represent Wall, Grass, and Empty, respectively. Output For each test case, first output the case number in one line, in the format: "Case :id" where id is the test case number, counting from 1. In the second line just output the maximum number of robots that can be placed in that map.
06-06
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值