| 6 | # |
| 7 | #You will get the money spent between the keyboard and the usb and sum it if it is less than the budget it will return the price spent |
| 8 | def getMoneySpent(keyboards, drives, b): |
| 9 | spend = -1 |
| 10 | #Check each cost of each keyboard with that of each usb will sum them until some result is less than the budget we have |
| 11 | for key in keyboards: |
| 12 | for d in drives: |
| 13 | if key + d <=b: |
| 14 | spend = max(spend, key + d) |
| 15 | |
| 16 | return spend |
| 17 | |
| 18 | #Get the input from the user the first line will get the max money to spend, the model of keyboard and the model of usb |
| 19 | if __name__ == '__main__': |