Advertisement
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 Raindrops
- {
- class Program
- {
- static void Main(string[] args)
- {
- double region = double.Parse(Console.ReadLine());
- decimal density = decimal.Parse(Console.ReadLine());
- decimal result = 0;
- for (int i = 0; i < region; i++)
- {
- double[] input = Console.ReadLine().Split(' ').Select(x => double.Parse(x)).ToArray();
- double raindropsCount = input[0];
- double squareMeters = input[1];
- //Console.WriteLine(raindropsCount / squareMeters);
- result += (decimal)(raindropsCount / squareMeters);
- }
- try
- {
- Console.WriteLine("{0:F3}", result / density);
- }
- catch (Exception e)
- {
- Console.WriteLine("{0:F3}", result);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement