Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let smallBottles = +gets();
- let bigBottles = +gets();
- let capacity = +gets();
- if(bigBottles >= (parseInt(capacity/5))){
- if(smallBottles>=(capacity%5)){
- print(capacity%5)
- } else {
- print('-1')
- }
- } else if (bigBottles<(parseInt(capacity/5))){
- if(smallBottles>=capacity-(bigBottles*5)){
- print(capacity-bigBottles*5)
- } else {
- print('-1')
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment