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.Numerics;
- using System.Threading.Tasks;
- class Program
- {
- static void Main()
- {
- int n = int.Parse(Console.ReadLine());
- long totalLength = 0;
- int cablecount = n;
- for(int i = 0;i<n;i++)
- {
- int length = int.Parse(Console.ReadLine());
- string measure = Console.ReadLine();
- if(measure == "meters")
- {
- length = length * 100;
- }
- if(length>=20)
- {
- totalLength += length;
- }
- else if(length<20)
- {
- cablecount--;
- }
- }
- totalLength -= (cablecount - 1) * 3;
- Console.WriteLine(totalLength/504);
- Console.WriteLine(totalLength%504);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment