Submission #3981347
Source Code Expand
A, B, C, K = map(int, input().split())
ans = 0
if K % 2 == 1:
ans = -A+B
else:
ans = A-B
if abs(ans) > 1000000000000000000:
print('Unfair')
else:
print(ans)
'''
A, B, C
1: B+C, A+C, A+B, -A+B
2: 2A+B+C, A+2B+C, A+B+2C, A-B
3: 2A+3B+3C, 3A+2B+3C, 3A+3B+2C, -A+B
4: 6A+5B+5C, 5A+6B+5C, 5A+5B+6C, A-B
5: 10A+11B+11C, 11A+10B+11C, 11A+11B+10C, -A+B
6: 22A+21B+21C, 21A+22B+21C, 21A+21B+22C, A-B
'''
Submission Info
Submission Time |
|
Task |
A - Fairness |
User |
taku689 |
Language |
Python (3.4.3) |
Score |
300 |
Code Size |
436 Byte |
Status |
AC |
Exec Time |
18 ms |
Memory |
3060 KB |
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
300 / 300 |
Status |
|
|
Set Name |
Test Cases |
Sample |
s1.txt, s2.txt, s3.txt |
All |
01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, s1.txt, s2.txt, s3.txt |
Case Name |
Status |
Exec Time |
Memory |
01.txt |
AC |
18 ms |
3060 KB |
02.txt |
AC |
17 ms |
2940 KB |
03.txt |
AC |
18 ms |
2940 KB |
04.txt |
AC |
17 ms |
2940 KB |
05.txt |
AC |
17 ms |
2940 KB |
06.txt |
AC |
17 ms |
2940 KB |
07.txt |
AC |
17 ms |
2940 KB |
08.txt |
AC |
17 ms |
2940 KB |
09.txt |
AC |
17 ms |
2940 KB |
s1.txt |
AC |
17 ms |
2940 KB |
s2.txt |
AC |
17 ms |
2940 KB |
s3.txt |
AC |
17 ms |
2940 KB |