Mihai has an 8×8 chessboard whose rows are numbered from 1 to 8 from top to bottom and whose columns are numbered from 1 to 8 from left to right.
Mihai has placed exactly one bishop on the chessboard. The bishop is not placed on the edges of the board. (In other words, the row and column of the bishop are between 2 and 7
, inclusive.)
(资料图片)
The bishop attacks in all directions diagonally, and there is no limit to the distance which the bishop can attack. Note that the cell on which the bishop is placed is also considered attacked.
An example of a bishop on a chessboard. The squares it attacks are marked in red.
Mihai has marked all squares the bishop attacks, but forgot where the bishop was! Help Mihai find the position of the bishop.
Input
The first line of the input contains a single integer t (1≤t≤36) — the number of test cases. The description of test cases follows. There is an empty line before each test case.
Each test case consists of 8 lines, each containing 8 characters. Each of these characters is either '#' or '.', denoting a square under attack and a square not under attack, respectively.
Output
For each test case, output two integers r and c (2≤r,c≤7) — the row and column of the bishop.
The input is generated in such a way that there is always exactly one possible location of the bishop that is not on the edge of the board.
3
.....#..
#...#...
.#.#....
..#.....
.#.#....
#...#...
.....#..
......#.
#.#.....
.#......
#.#.....
...#....
....#...
.....#..
......#.
.......#
.#.....#
..#...#.
...#.#..
....#...
...#.#..
..#...#.
.#.....#
#.......
output
Copy
4 32 24 5
Note
The first test case is pictured in the statement. Since the bishop lies in the intersection row 44 and column 33, the correct output is 4 3.
判断bishop在哪里,只要这个位置是#并且左上跟左下都是#,这个位置就是了,
依次遍历返回即可;
下面是代码:
关键词:
-
当前简讯:CF 1692C - Where's the Bishop?
Mihaihasan8×8chessboardwhoserowsarenumberedfrom1to8fromtoptobotto
-
海南姑娘林美媚将参加2023年亚洲沙滩排球锦标赛
新海南客户端、南海网6月15日消息(记者陈望)6月15日,记者从海南体育
-
连续30个跌停,“人参大王”落幕A股!4股进入退市倒计时
连续30个跌停,“人参大王”落幕A股!4股进入退市倒计时,退市,股价,股
-
今日最新!未通过网络安全审查!美光宣布在中国投资超43亿元
美光科技宣布,计划在未来几年中对其位于中国西安的封装测试工厂投资超
-
印尼羽毛球公开赛:中国男女双遗憾出局 雅思组合挺进四强_世界快看
世界排名第一的中国羽毛球女双“凡尘”组合陈清晨 贾一凡,16日在一场
-
全球新消息丨淮阳生活网(关于淮阳生活网介绍)
来为大家讲解以上的问题。淮阳生活网,阳生活网介绍这个很多人还不知道
-
锦篮基因完成近亿元pre-B轮融资,乾道基金、东方富海出手-环球资讯
基因治疗新药研发公司北京锦篮基因科技有限公司(以下简称“锦篮基因”
-
全球今头条!腾讯《阿凡达:重返潘多拉》手游将开测:虚幻4引擎打造
日前,腾讯官方正式宣布,《阿凡达》IP衍生手游《阿凡达:重返潘多拉》
-
每日看点!世界女排联赛:中国队战胜保加利亚队豪取六连胜
6月16日,世界女排联赛中国香港站,中国女排3-1战胜保加利亚队,取得开
-
环球讯息:地下城与勇士偷学技能任务怎么做_wow抗魔联军勇士招募一名新的随从怎么做
1、wow抗魔联军勇士招募一名新的随从:在破碎海滩接招募一名新的随从的
-
热点!志愿服务进社区 共创全国文明城|区市场监督管理局开展机关党支部进社区志愿服务活动
为进一步助力文明城市创建,增强辖区居民的卫生意识、环保意识和文明意
-
Nature发AIGC禁令!投稿中视觉内容使用AI的概不接收 最新快讯
西风发自凹非寺量子位|公众号QbitAI作为最权威的科学期刊之一,Nature
-
2023年“春蕾助学 澳鼎圆梦”公益活动捐赠暨启动仪式在北京举行 信息
2023年“春蕾助学澳鼎圆梦”公益活动捐赠暨启动仪式16日在北京举行。田
-
刘若英的知道不知道是翻唱的_知道不知道 2004年刘若英演唱的歌曲
《知道不知道》是由姚谦作词,王黎光根据陕北民谣改编作曲,刘若英演唱
-
“还债”路漫漫!大智慧实控人张长虹减持套现1.79亿元,已向公司支付逾亿元赔偿款
“还债”路漫漫!大智慧实控人张长虹减持套现1 79亿元,已向公司支付逾
-
张志丹:揭秘主力4种常见“盘口动作”!
看盘时必须关注盘口的几个表现
-
2023年苏州市社保缴费基数是多少?具体标准如下
2023年苏州市社会保险缴费基数是多少?社保网小编整理了最新资讯。2023
-
奶茶店投资大概多少_专业奶茶店投资成本-资讯
1、如果要开一家店,房租、装修、人力成本等前期投入在50万元到60万元
-
畅游极地世界,邂逅冰雪奇缘
三湘都市报6月16日讯(全媒体记者曾冠霖视频实习生宋科铖)6月16日,炎
-
中国移动动感地带有哪些套餐_中国移动动感地带
1、作为中国最大的移动通信运营商,中国移动通信在不断升级系统、提供