SHARE
TWEET

04. Elevator

VelizarAvramov Nov 14th, 2019 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace _04._Elevator
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             //int persons = int.Parse(Console.ReadLine());
  10.             //int capacity = int.Parse(Console.ReadLine());
  11.  
  12.             //int courses = (int)Math.Ceiling((double)persons / capacity);
  13.  
  14.             //Console.WriteLine($"{courses}");
  15.  
  16.             int persons = int.Parse(Console.ReadLine());
  17.             int capacity = int.Parse(Console.ReadLine());
  18.  
  19.             int courses = persons / capacity;
  20.  
  21.             if (persons % capacity != 0)
  22.             {
  23.                 courses++;
  24.             }
  25.             Console.WriteLine($"{courses}");
  26.         }
  27.     }
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top