Skip to content

Commit 257e85e

Browse files
authored
Solution
1 parent 7cd787d commit 257e85e

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/python3
2+
3+
import os
4+
import sys
5+
6+
def getMoneySpent(keyboards, drives, b):
7+
return max([sum([x,y]) for x in keyboards for y in drives if sum([x,y]) <= b]+[-1])
8+
9+
if __name__ == '__main__':
10+
fptr = open(os.environ['OUTPUT_PATH'], 'w')
11+
12+
bnm = input().split()
13+
14+
b = int(bnm[0])
15+
16+
n = int(bnm[1])
17+
18+
m = int(bnm[2])
19+
20+
keyboards = list(map(int, input().rstrip().split()))
21+
22+
drives = list(map(int, input().rstrip().split()))
23+
24+
moneySpent = getMoneySpent(keyboards, drives, b)
25+
26+
fptr.write(str(moneySpent) + '\n')
27+
28+
fptr.close()

0 commit comments

Comments
 (0)