package yukicoder; import java.util.Scanner; public class Main{ public static void main(String[] args){ new Main().solve(); } void solve(){ Scanner sc=new Scanner(System.in); int p=sc.nextInt(); int q=sc.nextInt(); int n=sc.nextInt(); long[] x=new long[n]; long[] y=new long[n]; long gcd=gcd(Math.abs(p),Math.abs(q)); for(int i=0;i