// Online C# Editor for free
// Write, Edit and Run your C# code using C# Online Compiler
using System;
public class HelloWorld
{
public static void Main()
{
double[] objects = new double[]{4,4,2};
Pack(objects, 3);
}
public static void Pack(double[] things, int numBags)
{
double[] results = new double[]{0,0,0};
double[] sumUp = new double[]{0,0,0};
for(int i = 0; i < things.Length; i++)
{
double current = things[i] / numBags;
double nextnumber = (double)Math.Floor(current);
results[i] = current;
double part = current - nextnumber;
sumUp[i] = part;
Console.WriteLine(results[i] + "/" + Math.Floor(current) + "/" + part);
}
for(int b = 0; b < sumUp.Length; b++)
{
sumUp[b] = sumUp[b] * numBags;
Console.WriteLine(sumUp[b]);
}
}
}