You are on page 1of 7

E-OLYMP

1) Simple problem?
Program reads two-digit number and prints every digit separately, separated by a space.
Input
One integer from 10 to 99 including.
Output
Two digits separated by a space.
Input example #1
23
Output example #1
2 3

2) Digits
Find the number of digits in a nonnegative integer n.

Input
One nonnegative integer n (0 n 2109).

Output
The number of digits in number n.
Input example #1
12343
Output example #1
5

3) Matchs model
Samodelkin, Professor decided make by hand volumetric model bricks from matches, and
use the matches for edges. Length of edges of every brick equally for one match.
For models construction of three bricks he uses 28 matches.
What least quantity of matches Samodelkin needs for construction of model
with N bricks?
Every number of problems does not exceed 2109.

Input
One number N is quantity of bricks.

Output
One number is quantity of matches.
Input example #1
3
Output example #1
28

4) Two circles

How many
points in
common two
given
circles
have?
Input
Six numbers x1, y1, r1, x2, y2, r2, where x1, y1, x2, y2 are the coordinates of the centers of
the circles, r1, r2 are its radii.

Output
The number of common points for two circles: 0, 1 or 2. Print -1 if circles have a lot of
common points.
Input example #1
0 0 5 5 0 1
Output example #1
2

5) Two factors
Which the least number n can we imagine in product n = ab like k ways?
Products ab and ba is one of the way, where all numbers is natural (1 k 50).
Input
One number k.
Output
One number n.
Input example #2

2
Output example #2
4

6) The vouchers
The tour operator did not sell n (n < 15) vouchers to mountain-ski resort because of the
great frost. The terms of vouchers validity is already come. To reduce the losses, it was
decided from the February 1, that all the vouchers for which remained dk (dk 30) days,
to sell for minimal cost for ck (ck 100) UAH for a day only for that days, which
remained from the sale day (k = 1..n).
What is the largest amount of income can get the travel company selling these vouchers,
if one voucher can be sold only in one day?

Input
The first line contains the number of vouchers n. Each of the next n lines contains two
numbers - the number of days dk left and the cost of each day ck.

Output
The maximum amount of income.
Input example #10
4
2 37
3 45
1 46
4 30
Output example #10
232

7) Roman numerals
Count the sum of two natural numbers and , which have written in roman system of
numeration. The answer you must write too in roman system of numeration.
= 1000, D = 500, = 100, L = 50, X = 10, V = 5, I = 1 (all numbers is less 2000).
Input
In line wrote two number of roman system numeration, between which stand mark "+".
Output
One number, sum of numbers is roman system numeration too. Numbers in roman system
numeration wrote big Latin letters.
Input example #1
III+IV
Output example #1
VII

8) Matches
What is the minimum number of matches you need to put on the plane n squares with the
side in one match? Matches can not break and laying on top of each other. The vertices of

the squares should be the point where the ends of matches converge, and the parties matches themselves.
Write a program that by the number of squares of the n , which is necessary to make, is
the minimum required for this amount of matches.
Input data
One integer n ( 1 n 10 9 ).
Output
Print the minimum number of matches required for the preparation of n squares.
Input example # 1
4
Output example # 1
12

9) N-digit numbers
Find the quantity of N-digit numbers, which the sum is equal to their product. Call the
least from numbers for given N (N < 10).
Input
The number N is not exceeding 10.
Output
In output file have written 2 numbers: a quantity of numbers and a less number through
blank.
Input example #1
1
Output example #1
10 0

10) Gardener

The Gardener planted N trees during the day. And he had to pour out one pail of water
under each seedling. It was raining that day, so the Gardener began to water the trees not
from the day of planting, but from someK-th day.
How many days the Gardener didnt water the trees, if he poured 1/N part of water of a
pail under every tree in last day, the day before it - 1/(N-1) part, etc. and in whole he
poured under every tree no more than a half of pail of water?
Input
The number of the treesN. 0 < N 1000000.
Output
The number of days the Gardener didnt water the trees since day of planting.
Input example #3
3
Output example #3
2

You might also like