Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $amountOfRegions = intval(readline());
- $density = floatval(readline());
- $regionalCoefficientsSum = 0.000;
- while ($amountOfRegions--) {
- $input = explode(" ", readline());
- $raindropsCount = intval($input[0]);
- $squareMeters = intval($input[1]);
- $regionalCoefficientsSum += $raindropsCount / $squareMeters;
- }
- echo number_format($regionalCoefficientsSum / ($density ? $density : 1), 3, '.', '');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement