Masala #1150
Kamondan o'q otish
R – radiusli doira shaklidagi nishon taxtasi berilgan. Ushbu nishon taxtasi 1/2, 1/4, 1/6 kichik radiusli aylanalarga ajratilgan bo‘lib, mos ravishda A, B, C ballga ega. Ravshan bobosi yasab bergan kamon yordamida ushbu taxtaga N ta o‘q otdi. O‘qlar nishon taxtasining (xi, yi) nuqtalariga tegdi. Ravshanbek jami N ta o'q yordamida necha ball to'plaganini topib beruvchi dastur tuzing.
Birinchi qatorda N (1 ≤ N ≤ 105) va R (1 ≤ R ≤ 109) mos ravishda o'qlar soni hamda nishon taxtasi radiusi
Ikkinchi qatorda A, B, C (1 < A < B < C < 109) aylanalarga tekkanda beriluvchi ballar
N ta qatorda o'q tekkan koordinata xi, yi (-109 ≤ xi, yi ≤ 109) kiritiladi.
Masala shartida so'ralgan natijani chop eting.
# | input.txt | output.txt |
---|---|---|
1 |
2 12 2 3 6 0 2 5 0 |
8 |
Agarda o‘q chiziq ustiga tekkan bo‘lsa kichikroq aylanaga tegishli bo‘ladi.