Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace _2.StudentCables
- {
- using System;
- public class StudentCables
- {
- public static void Main(string[] args)
- {
- checked
- {
- int numCables = int.Parse(Console.ReadLine());
- int cableLength = 0;
- int countCables = 0;
- for (int i = 0; i < numCables; i++)
- {
- int cable = int.Parse(Console.ReadLine());
- string measure = Console.ReadLine();
- if (measure == "meters")
- {
- cable *= 100;
- }
- if (cable >= 20)
- {
- cableLength += cable;
- countCables++;
- }
- }
- if (countCables > 1)
- {
- cableLength -= 3 * (countCables - 1);
- }
- int studentCables = cableLength / 504;
- int remainCable = cableLength % 504;
- Console.WriteLine(studentCables);
- Console.WriteLine(remainCable);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement