momo3141

Mineral Water ver2

Nov 19th, 2022
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. let smallBottles = +gets();
  2. let bigBottles = +gets();
  3. let capacity = +gets();
  4. if(bigBottles >= (parseInt(capacity/5))){
  5. if(smallBottles>=(capacity%5)){
  6. print(capacity%5)
  7. } else {
  8. print('-1')
  9. }
  10. } else if (bigBottles<(parseInt(capacity/5))){
  11. if(smallBottles>=capacity-(bigBottles*5)){
  12. print(capacity-bigBottles*5)
  13. } else {
  14. print('-1')
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment