CF287A.IQ Test

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

In the city of Ultima Thule job applicants are often offered an IQ test.

The test is as follows: the person gets a piece of squared paper with a 4×44×4 square painted on it. Some of the square's cells are painted black and others are painted white. Your task is to repaint at most one cell the other color so that the picture has a 2×22×2 square, completely consisting of cells of the same color. If the initial picture already has such a square, the person should just say so and the test will be completed.

Your task is to write a program that determines whether it is possible to pass the test. You cannot pass the test if either repainting any cell or no action doesn't result in a 2×22×2 square, consisting of cells of the same color.

输入格式

Four lines contain four characters each: the jj -th character of the ii -th line equals "." if the cell in the ii -th row and the jj -th column of the square is painted white, and "#", if the cell is black.

输出格式

Print "YES" (without the quotes), if the test can be passed and "NO" (without the quotes) otherwise.

输入输出样例

  • 输入#1

    ####
    .#..
    ####
    ....
    

    输出#1

    YES
    
  • 输入#2

    ####
    ....
    ####
    ....
    

    输出#2

    NO
    

说明/提示

In the first test sample it is enough to repaint the first cell in the second row. After such repainting the required 2×22×2 square is on the intersection of the 11 -st and 22 -nd row with the 11 -st and 22 -nd column.

首页