You are on page 1of 2

Lietuvos mokinių informatikos olimpiada

Šalies et. (2) • 2023 m. kovo 23-26 d. • X–XII kl. sviesa-vyr

Šviesa
In a two dimensional universe, in a far away galaxy, there is a star and N planets. The planet
coordinates as well as their radii are known, and the star is at (0, 0) coordinates.

Užduotis. Calculate what percentage of star light each planet gets. All light originates from
the center of the star, which is at (0, 0), equally in all directions. All planets are disk-shaped,
and can block light for each other.

Pradiniai duomenys. The first line contains integer N – the number of planets.
The remaining N lines contain 3 integers each – i + 1-st line contains numbers xi , yi and ri –
the coordinates and radius of the i-th planet.

Rezultatai. Output N lines, each containing real number signifiying the percentage of star
light the respective planet gets.
The answer is considered correct if the difference from the correct value is no more than 10−6 .

Pavyzdžiai.

Pradiniai duomenys Rezultatai Paaiškinimas


3 18.808063785 The first planet is entirely in star-
5 2 3 4.612514045 light, the second planet is partly in
12 -2 4 0 shadow of the first planet, and the
10 5 1 third planet is entirely in shadow.

≈18.8%

≈4.6%

Ribojimai. The following constraints hold for all tests 2 ≤ N ≤ 100000, −109 ≤ xi , yi ≤ 109 ,
1 ≤ ri ≤ 109 (for all 1 ≤ i ≤ N ), planets don’t intersect and don’t touch among each other,
and don’t contain or touch the point (0, 0).

Dalinės užduotys. Subtask points are only awarded if all tests of that subtask are passed.

1 psl. iš 2
Lietuvos mokinių informatikos olimpiada
Šalies et. (2) • 2023 m. kovo 23-26 d. • X–XII kl. sviesa-vyr

No. Points Additional constraints


1 23 All planets are fully lit.
2 22 N ≤ 5000 and each planet is either fully lit, or fully in shadow.
3 26 N ≤ 5000
4 29 No additional constraints.

2 psl. iš 2

You might also like