Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication4
- {
- class Program
- {
- static void Main(string[] args)
- {
- int n = int.Parse(Console.ReadLine());
- int counter = 0;
- int cableLength = 0;
- string system = string.Empty;
- int sum = 0;
- int losed = 0;
- while (counter < n)
- {
- cableLength = int.Parse(Console.ReadLine());
- system = Console.ReadLine();
- if (system == "meters")
- {
- sum += (cableLength * 100);
- losed++;
- }
- if (system == "centimeters")
- {
- if (cableLength < 20)
- {
- sum += 0;
- }
- else
- {
- sum += (cableLength);
- losed++;
- }
- }
- counter++;
- }
- int cable = (int)(sum - (losed - 1) * 3);
- int output = 0;
- int outputSecond = 0;
- for (int i = 504; i < cable; i+=504)
- {
- output += 1;
- outputSecond += 504;
- }
- Console.WriteLine(output);
- Console.WriteLine(cable - outputSecond);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment