R=range;I=lambda:map(float,raw_input().split());x,y=I();N=input() M=10**6;U=1<