167622025-05-12 11:36:45horkaWashington Distancepython3Wrong answer 0/10085ms3164 KiB
t=int(input())
for _ in range(t):
    s=input().split(" ")
    x1=int(s[2])
    x2=int(s[5])
    y1=ord(s[1])-65
    y2=ord(s[4])-65
    print(x1,x2)
    if(s[0][0]=='S'):
        x1=-1*(26-x1)
        if(abs(x1)==26): x1=0
    if(s[3][0]=='S'):
        x2=-1*(26-x2)
        if(abs(x2)==26): x2=0
    if(s[0][1]=='W'):
        y1*=-1
    if(s[3][1]=='W'):
        y2*=-1
    #print(x1, y1, x2, y2)
    print(abs(x1-x2)+abs(y1-y2))
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer14ms3124 KiB
subtask20/20
2Wrong answer17ms3124 KiB
3Wrong answer48ms3124 KiB
4Wrong answer78ms3124 KiB
subtask30/80
5Wrong answer17ms3120 KiB
6Wrong answer17ms3124 KiB
7Wrong answer48ms3124 KiB
8Wrong answer78ms3124 KiB
9Wrong answer17ms3012 KiB
10Wrong answer48ms3164 KiB
11Wrong answer76ms3112 KiB
12Wrong answer85ms3124 KiB
13Wrong answer83ms3124 KiB
14Wrong answer83ms3124 KiB