Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 8////////////////////////////////////////////////////////////////////////////////////////
- int n = int.Parse(Console.ReadLine());
- int totalLength = 0;
- for (int i = 0; i < n; i++)
- {
- int length = int.Parse(Console.ReadLine());
- string measure = Console.ReadLine();
- if (measure == "meters")
- {
- // Convert meters to centimeters
- length = length * 100;
- }
- if (length >= 20)
- {
- totalLength = totalLength + (length - 3);
- }
- }
- // Substract the lost length for joining the cables
- totalLength += 3;
- int cablesCount = totalLength / 504;
- int remainder = totalLength % 504;
- Console.WriteLine(cablesCount);
- Console.WriteLine(remainder);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement