import java.util.*; public class OreJohn { public static final int MAXCARS = 50; public static final int MAXHOPPERS = 100; public static int[] a = new int[MAXCARS]; public static int[] b = new int[MAXCARS]; public static int[] t = new int[MAXHOPPERS]; class Node { public long iA, iB, iT; public Node(long a, long b, long t) { iA = a; iB = b; iT = t; } } static class GCD { public long g, x, y; } public static Queue list = new LinkedList<>(); public static void gcd(long a, long b, GCD ans) { if (b == 0) { ans.x = 1; ans.y = 0; ans.g = a; return; } gcd(b, a % b, ans); long sav = ans.x; ans.x = ans.y; ans.y = sav - ans.y* (a / b); } /* public static boolean find_any_solution(long a, long b, long c, GCD ginfo) { gcd(abs(a), abs(b), ginfo); long g = ginfo.g; if (c % g) { return false; } ginfo.x *= c / g; ginfo.y *= c / g; if (a < 0) ginfo.x *= -1; if (b < 0) ginfo.y *= -1; return true; } /**/ public static boolean possible(long target, long totA, long totB, long x, long y, long g) { if (target % g != 0) { return false; } x *= target / g; y *= target / g; if (x < 0) { long d = y/(totA/g); x += d*totB/g; y -= d*totA/g; } else if (y < 0) { long d = x/(totB/g); y += d*totA/g; x -= d*totB/g; } //cout << totA << '*' << x << '+' << totB << '*' << y << '=' << target << endl; return (x >= 0 && y >= 0); } public static void main(String [] args) { int nA, nB, nT; long totA = 0, totB = 0; Scanner in = new Scanner(System.in); nA = in.nextInt(); nB = in.nextInt(); nT = in.nextInt(); for(int i=0; i