Submission #3603331


Source Code Expand

h,w=map(int,input().split())
s=[]
if h%3==0 or w%3==0:
    print(0)
else:
    for i in range(1,h):
        a=max(i*w,((h-i)*(w//2)),w*(h-i)//2)
        b=min(i*w,((h-i)*(w//2)),w*(h-i)//2)
        s.append((abs(a-b)))
    for j in range(1,w):
        a=max(h*j,(h//2)*(w-j),h*((w-j)//2))
        b=min(h*j,(h//2)*(w-j),h*((w-j)//2))
        s.append(abs(a-b))
print(min(s))

Submission Info

Submission Time
Task C - Chocolate Bar
User shel
Language Python (3.4.3)
Score 0
Code Size 386 Byte
Status RE
Exec Time 301 ms
Memory 11032 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 400
Status
AC × 4
RE × 1
AC × 9
WA × 4
RE × 7
Set Name Test Cases
Sample 0_00.txt, 0_01.txt, 0_02.txt, 0_03.txt, 0_04.txt
All 0_00.txt, 0_01.txt, 0_02.txt, 0_03.txt, 0_04.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt, 1_08.txt, 1_09.txt, 1_10.txt, 1_11.txt, 1_12.txt, 1_13.txt, 1_14.txt
Case Name Status Exec Time Memory
0_00.txt RE 18 ms 3064 KB
0_01.txt AC 18 ms 3064 KB
0_02.txt AC 18 ms 3064 KB
0_03.txt AC 158 ms 6984 KB
0_04.txt AC 301 ms 11032 KB
1_00.txt AC 17 ms 3064 KB
1_01.txt AC 164 ms 7032 KB
1_02.txt RE 18 ms 3064 KB
1_03.txt RE 18 ms 3064 KB
1_04.txt WA 105 ms 5452 KB
1_05.txt WA 184 ms 7692 KB
1_06.txt RE 18 ms 3064 KB
1_07.txt RE 18 ms 3064 KB
1_08.txt AC 168 ms 7236 KB
1_09.txt AC 190 ms 7964 KB
1_10.txt WA 252 ms 9548 KB
1_11.txt RE 18 ms 3064 KB
1_12.txt RE 18 ms 3064 KB
1_13.txt AC 161 ms 7100 KB
1_14.txt WA 97 ms 5348 KB