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