-
Notifications
You must be signed in to change notification settings - Fork 175
/
Copy pathlibrary-fine.py
61 lines (44 loc) · 1.1 KB
/
library-fine.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'libraryFine' function below.
#
# The function is expected to return an INTEGER.
# The function accepts following parameters:
# 1. INTEGER d1
# 2. INTEGER m1
# 3. INTEGER y1
# 4. INTEGER d2
# 5. INTEGER m2
# 6. INTEGER y2
#
def libraryFine(d1, m1, y1, d2, m2, y2):
if y1 > y2:
return 10000
elif y1 < y2:
return 0
if m1 > m2:
return (m1 - m2) * 500
elif m1 < m2:
return 0
if d1 > d2:
return (d1 - d2) * 15
else:
return 0
if __name__ == '__main__':
fptr = open(os.environ['OUTPUT_PATH'], 'w')
first_multiple_input = input().rstrip().split()
d1 = int(first_multiple_input[0])
m1 = int(first_multiple_input[1])
y1 = int(first_multiple_input[2])
second_multiple_input = input().rstrip().split()
d2 = int(second_multiple_input[0])
m2 = int(second_multiple_input[1])
y2 = int(second_multiple_input[2])
result = libraryFine(d1, m1, y1, d2, m2, y2)
fptr.write(str(result) + '\n')
fptr.close()