Professional Documents
Culture Documents
Sviesa-Vyr (En)
Sviesa-Vyr (En)
Š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.
≈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
2 psl. iš 2