Hi ,
I solved A1 like everybody else but now I have problems with A2 and A3. My main idea is not that special, try every number for P and generate all possible q and stop if you enter in the circle with map, so that idea is O(N^2) and that is not good. Can anyone help me and say some suggestion for that problem.
Task link









Central European Olympiad in Informatics 2013 will be accompanied by an Internet online contest.
The Croatia selected a team for this year programing competition IOI 2013 and CEOI 2013 which will be held in Primošten, Croatia. This year the best programer is Domagoj Ćevid. He won last year silver medal(IOI 2012) and gold medal at mathematical world competition 2012. The youngest programmer in the team is Ivan Lazarić. He won 3 place in the final competition and he is national winner in his category. Only Domagoj had experience at big programming competition but I am sure that we will have a great score like the last or previous year.