Advertisement
Iskrenov84

09. Spice Must Flow

Feb 12th, 2022
990
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.92 KB | None | 0 0
  1. using System;
  2. using System.Numerics;
  3. using System.Linq;
  4. using System.Collections.Generic;
  5. namespace Test
  6. {
  7.     internal class Program
  8.     {
  9.         static void Main(string[] args)
  10.         {
  11.  
  12.             int yeld = int.Parse(Console.ReadLine());
  13.  
  14.             int spice = yeld;
  15.             int leavingSpice = 0;
  16.             int days = 0;
  17.             if (yeld < 100)
  18.             {
  19.                 Console.WriteLine(days);
  20.                 Console.WriteLine(leavingSpice);
  21.                 return;
  22.             }
  23.             while (yeld >= 100)
  24.             {
  25.                 if (yeld >= 100)
  26.                 {
  27.                     spice = yeld - 26;
  28.                     yeld -= 10;
  29.                     days++;
  30.                     leavingSpice += spice;
  31.                 }
  32.             }
  33.            
  34.             Console.WriteLine(days);
  35.             Console.WriteLine($"{leavingSpice - 26}");
  36.         }  
  37.     }
  38. }
  39.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement