Main page Tasks Volumes Ranking Help

Back to task list

Rounding

There are several pairs of numbers. For each pair you are to divide first by second and return the result, rounded to nearest integer.

In cases, when result contains exactly 0.5 as a fraction part, value should be rounded up (i.e. to next integer greater than given one). Note that for negative values "greater" means "closer to zero". Refer to the Wikipedia page on Rounding for more thorough explanations.

In any further problems, when rounding is mentioned - just the same rounding algorithm is supposed (unless other is explicitly specified).

Example:

data:
12 8
11 -3
400 5

result:
2 -4 80
You need to login to get test data and submit solution.