Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- var packageDemand = Convert.ToInt32(Console.ReadLine());
- var boxSize = 320;
- var stackSize = 8;
- int boxCount = 0;
- int stackCount = 0;
- int packageCount = 0;
- while (packageDemand > 0)
- {
- if (packageDemand > boxSize)
- {
- boxCount = packageDemand / boxSize;
- packageDemand -= boxCount * boxSize;
- } else if (packageDemand > stackSize)
- {
- stackCount = packageDemand / stackSize;
- packageDemand -= stackCount * stackSize;
- } else
- {
- packageCount = packageDemand;
- packageDemand = 0;
- }
- }
- Console.WriteLine(boxCount + " " + stackCount + " " +packageCount);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement