CSES - HIIT Open 2018 - Results
Test results
testverdicttime
#10.23 sdetails
#20.28 sdetails
#30.25 sdetails
#40.22 sdetails
#50.26 sdetails
#60.29 sdetails
#70.27 sdetails
#80.26 sdetails

### Code

```t = int(input())

for _ in range(t):
min_x = (1000, 1000)
min_y = (1000, 1000)
max_x = (-1000, -1000)
max_y = (-1000, -1000)
res = 4
for y in range(100):
c = input()
for x in range(100):
if c[x] == "1":
if x < min_x:
min_x = (y, x)
if y < min_y:
min_y = (y, x)
if x > max_x:
max_x = (y, x)
if y > max_y:
max_y = (y, x)

# print(min_x, min_y, max_x, max_y)
# print(min_x, min_y, max_x, max_y)
diff = 3

if abs(min_x - min_y) <= diff or abs(min_x - max_y) <= diff:
res = 3
if abs(max_x - min_y) <= diff or abs(max_x - max_y) <= diff:
res = 3
if abs(min_y - min_x) <= diff or abs(min_y - max_x) <= diff:
res = 3
if abs(max_y - min_x) <= diff or abs(max_y - max_x) <= diff:
res = 3

print(res)

```

### Test details

#### Test 1

Verdict:

input
100
000000000000000000000000000000...

correct output
3
3
3
3
4
...

user output
3
3
3
3
3
...

#### Test 2

Verdict:

input
100
000000000000000000000000000000...

correct output
3
4
4
4
3
...

user output
3
4
3
3
3
...

#### Test 3

Verdict:

input
100
000000000000000000000000000000...

correct output
3
3
3
3
4
...

user output
3
3
3
3
3
...

#### Test 4

Verdict:

input
100
000000000000000000000000000000...

correct output
3
3
3
4
3
...

user output
3
3
3
3
3
...

#### Test 5

Verdict:

input
100
000000000000000000000000000000...

correct output
3
4
3
3
4
...

user output
3
4
3
3
4
...

#### Test 6

Verdict:

input
100
000000000000000000000000000000...

correct output
4
3
4
4
4
...

user output
4
3
3
4
4
...

#### Test 7

Verdict:

input
100
000000000000000000000000000000...

correct output
4
4
3
3
3
...

user output
3
4
3
3
3
...

#### Test 8

Verdict:

input
100
000000000000000000000000000000...

correct output
3
3
3
3
3
...

user output
3
3
3
3
3
...