Submission #3140493


Source Code Expand

x,y = map(lambda x:int(x.replace('.','')),input().split())
if x%1000 == 0 and y%1000 == 0:
    x1 = x3 = x4 = x//1000
    y1 = y3 = y2 = y//1000
    x2 = x1 + 1
    y4 = y1 + 1
    print(x1,y1,x2,y2)
    print(x3,y3,x4,y4)
    exit()

if x%1000 == 0 or y%1000 == 0:
    rev = False
    if x%1000 == 0:
        x,y = y,x
        rev = True
    l = x//1000
    r = l + 1
    h = y//1000
    b = h - x%1000
    t = b + 1000
    if rev:
        print(h,l,h,r)
        print(b,l,t,r)
    else:
        print(l,h,r,h)
        print(l,b,r,t)
    exit()

x1 = x//1000 * 1000
x3 = x1 + 1000
y1 = y3 = y//1000 * 1000

dx_r = x%1000
dx_l = 1000 - dx_r
dy = y%1000

x4 = x2 = x
y4 = y2 = y
while True:
    y2 += dy
    x2 += dx_r
    if y2%1000 == 0 and x2%1000 == 0:
        break
while True:
    y4 += dy
    x4 -= dx_l
    if y4%1000 == 0 and x4%1000 == 0:
        break

print(x1//1000, y1//1000, x2//1000, y2//1000)
print(x3//1000, y3//1000, x4//1000, y4//1000)

Submission Info

Submission Time
Task B - 交点
User prd_xxx
Language Python (3.4.3)
Score 100
Code Size 1004 Byte
Status AC
Exec Time 18 ms
Memory 3064 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 27
Set Name Test Cases
All scrambled_00.txt, scrambled_01.txt, scrambled_02.txt, scrambled_03.txt, scrambled_04.txt, scrambled_05.txt, scrambled_06.txt, scrambled_07.txt, scrambled_08.txt, scrambled_09.txt, scrambled_10.txt, scrambled_11.txt, scrambled_12.txt, scrambled_13.txt, scrambled_14.txt, scrambled_15.txt, scrambled_16.txt, scrambled_17.txt, scrambled_18.txt, scrambled_19.txt, scrambled_20.txt, scrambled_21.txt, scrambled_22.txt, scrambled_23.txt, scrambled_24.txt, scrambled_25.txt, scrambled_26.txt
Case Name Status Exec Time Memory
scrambled_00.txt AC 17 ms 3064 KB
scrambled_01.txt AC 17 ms 3064 KB
scrambled_02.txt AC 18 ms 3064 KB
scrambled_03.txt AC 18 ms 3064 KB
scrambled_04.txt AC 17 ms 3064 KB
scrambled_05.txt AC 17 ms 3064 KB
scrambled_06.txt AC 18 ms 3064 KB
scrambled_07.txt AC 18 ms 3064 KB
scrambled_08.txt AC 17 ms 3064 KB
scrambled_09.txt AC 18 ms 3064 KB
scrambled_10.txt AC 17 ms 3064 KB
scrambled_11.txt AC 17 ms 3064 KB
scrambled_12.txt AC 18 ms 3064 KB
scrambled_13.txt AC 17 ms 3064 KB
scrambled_14.txt AC 17 ms 3064 KB
scrambled_15.txt AC 17 ms 3064 KB
scrambled_16.txt AC 18 ms 3064 KB
scrambled_17.txt AC 18 ms 3064 KB
scrambled_18.txt AC 18 ms 3064 KB
scrambled_19.txt AC 18 ms 3064 KB
scrambled_20.txt AC 18 ms 3064 KB
scrambled_21.txt AC 17 ms 3064 KB
scrambled_22.txt AC 17 ms 3064 KB
scrambled_23.txt AC 18 ms 3064 KB
scrambled_24.txt AC 18 ms 3064 KB
scrambled_25.txt AC 17 ms 3064 KB
scrambled_26.txt AC 17 ms 3064 KB