Advertisement
petarkobakov

Spice Must Flow

Jun 1st, 2020
399
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Spice_Must_Flow
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int startingYield = int.Parse(Console.ReadLine());
  10. int day = 0;
  11.  
  12. int consumption = 26;
  13. int leaving = 0;
  14. if (startingYield<100)
  15. {
  16. Console.WriteLine(day);
  17. Console.WriteLine(leaving);
  18. return;
  19. }
  20. while (startingYield >=100)
  21. {
  22. int yield = startingYield;
  23. yield -= consumption;
  24. leaving += yield;
  25. startingYield -= 10;
  26. day++;
  27.  
  28. }
  29. leaving -= consumption;
  30. Console.WriteLine(day);
  31. Console.WriteLine(leaving);
  32. }
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement