Claw Contraption

Advent of Code 2024 [Day 13]

13-12-2024

Next up: the lobby of a resort on a tropical island. The Historians take a moment to admire the hexagonal floor tiles before spreading out.

Fortunately, it looks like the resort has a new arcade! Maybe you can win some prizes from the claw machines?

The claw machines here are a little unusual. Instead of a joystick or directional buttons to control the claw, these machines have two buttons labeled A and B. Worse, you can’t just put in a token and play; it costs 3 tokens to push the A button and 1 token to push the B button.

With a little experimentation, you figure out that each machine’s buttons are configured to move the claw a specific amount to the right (along the X axis) and a specific amount forward (along the Y axis) each time that button is pressed.

Each machine contains one prize; to win the prize, the claw must be positioned exactly above the prize on both the X and Y axes.

You wonder: what is the smallest number of tokens you would have to spend to win as many prizes as possible? You assemble a list of every machine’s button behavior and prize location (your puzzle input). For example:

Button A: X+94, Y+34
Button B: X+22, Y+67
Prize: X=8400, Y=5400

Button A: X+26, Y+66
Button B: X+67, Y+21
Prize: X=12748, Y=12176

Button A: X+17, Y+86
Button B: X+84, Y+37
Prize: X=7870, Y=6450

Button A: X+69, Y+23
Button B: X+27, Y+71
Prize: X=18641, Y=10279

This list describes the button configuration and prize location of four different claw machines.

For now, consider just the first claw machine in the list:

The cheapest way to win the prize is by pushing the A button 80 times and the B button 40 times. This would line up the claw along the X axis (because 80*94 + 40*22 = 8400) and along the Y axis (because 80*34 + 40*67 = 5400). Doing this would cost 80*3 tokens for the A presses and 40*1 for the B presses, a total of 280 tokens.

For the second and fourth claw machines, there is no combination of A and B presses that will ever win a prize.

For the third claw machine, the cheapest way to win the prize is by pushing the A button 38 times and the B button 86 times. Doing this would cost a total of 200 tokens.

So, the most prizes you could possibly win is two; the minimum tokens you would have to spend to win all (two) prizes is 480.

You estimate that each button would need to be pressed no more than 100 times to win a prize. How else would someone be expected to play?

Figure out how to win as many prizes as possible. What is the fewest tokens you would have to spend to win all possible prizes?

interface Machine {
  buttonA: { x: number; y: number };
  buttonB: { x: number; y: number };
  prize: { x: number; y: number };
}

function parseMachines(input: string): Machine[] {
  const lines = input.trim().split("\n");
  const machines: Machine[] = [];

  for (let i = 0; i < lines.length; i += 4) {
    const [aX, aY] = lines[i].match(/X\+(\d+), Y\+(\d+)/)!.slice(1).map(Number);
    const [bX, bY] = lines[i + 1].match(/X\+(\d+), Y\+(\d+)/)!.slice(1).map(Number);
    const [pX, pY] = lines[i + 2].match(/X=(\d+), Y=(\d+)/)!.slice(1).map(Number);

    machines.push({
      buttonA: { x: aX, y: aY },
      buttonB: { x: bX, y: bY },
      prize: { x: pX, y: pY }
    });
  }
  return machines;
}

function solve(machine: Machine): number | null {
  for (let a = 0; a <= 100; a++) {
    for (let b = 0; b <= 100; b++) {
      const x = a * machine.buttonA.x + b * machine.buttonB.x;
      const y = a * machine.buttonA.y + b * machine.buttonB.y;
      
      if (x === machine.prize.x && y === machine.prize.y) {
        return a * 3 + b;
      }
    }
  }
  return null;
}

function findMinimumTokens(machines: Machine[]): number {
  let totalTokens = 0;

  for (const machine of machines) {
    const tokens = solve(machine);
    if (tokens !== null) {
      totalTokens += tokens;
    }
  }

  return totalTokens;
}

async function main() {
  const input = await Deno.readTextFile("input.txt");
  const machines = parseMachines(input);
  const result = findMinimumTokens(machines);
  console.log(`Minimum tokens needed: ${result}`);
}

main().catch((err) => console.error(err));

As you go to win the first prize, you discover that the claw is nowhere near where you expected it would be. Due to a unit conversion error in your measurements, the position of every prize is actually 10000000000000 higher on both the X and Y axis!

Add 10000000000000 to the X and Y position of every prize. After making this change, the example above would now look like this:

Button A: X+94, Y+34
Button B: X+22, Y+67
Prize: X=10000000008400, Y=10000000005400

Button A: X+26, Y+66
Button B: X+67, Y+21
Prize: X=10000000012748, Y=10000000012176

Button A: X+17, Y+86
Button B: X+84, Y+37
Prize: X=10000000007870, Y=10000000006450

Button A: X+69, Y+23
Button B: X+27, Y+71
Prize: X=10000000018641, Y=10000000010279

Now, it is only possible to win a prize on the second and fourth claw machines. Unfortunately, it will take many more than 100 presses to do so.

Using the corrected prize coordinates, figure out how to win as many prizes as possible. What is the fewest tokens you would have to spend to win all possible prizes?

interface Machine {
  buttonA: { x: number; y: number };
  buttonB: { x: number; y: number };
  prize: { x: number; y: number };
}

function parseMachines(input: string): Machine[] {
  const lines = input.trim().split("\n");
  const machines: Machine[] = [];

  for (let i = 0; i < lines.length; i += 4) {
    const [aX, aY] = lines[i].match(/X\+(\d+), Y\+(\d+)/)!.slice(1).map(Number);
    const [bX, bY] = lines[i + 1].match(/X\+(\d+), Y\+(\d+)/)!.slice(1).map(Number);
    const [pX, pY] = lines[i + 2].match(/X=(\d+), Y=(\d+)/)!.slice(1).map(Number);

    machines.push({
      buttonA: { x: aX, y: aY },
      buttonB: { x: bX, y: bY },
      prize: { x: pX + 10000000000000, y: pY + 10000000000000 }
    });
  }
  return machines;
}

function solveDiophantine(machine: Machine): number | null {
  const det = machine.buttonA.x * machine.buttonB.y - machine.buttonB.x * machine.buttonA.y;
  if (det === 0) {
    console.log("determinant is zero");
    return null;
  }

  const x0 = ((machine.buttonB.y * machine.prize.x - machine.buttonB.x * machine.prize.y) / det);
  const y0 = ((machine.buttonA.x * machine.prize.y - machine.buttonA.y * machine.prize.x) / det);
  let calculateX = machine.buttonA.x * x0 + machine.buttonB.x * y0;
  let calculateY = machine.buttonA.y * x0 + machine.buttonB.y * y0;

  if (
    x0 < 0 || y0 < 0 || 
    !Number.isInteger(x0) ||
    !Number.isInteger(y0)
  ) {
    return null;
  }

  console.log(`found diophantine solution: x=${calculateX}, y=${calculateY}`);
  return x0 * 3 + y0;
}

function findMinimumTokens(machines: Machine[]): number {
  let totalTokens = 0;
  for (const machine of machines) {
    const tokens = solveDiophantine(machine);
    if (tokens !== null) {
      totalTokens += tokens;
    }
  }
  return totalTokens;
}

async function main() {
  const input = await Deno.readTextFile("input.txt");
  const machines = parseMachines(input);
  const result = findMinimumTokens(machines);
  console.log(`Minimum tokens needed: ${result}`);
}

main().catch((err) => console.error(err));
Click to show the input
Button A: X+92, Y+17
Button B: X+27, Y+61
Prize: X=9152, Y=6172

Button A: X+12, Y+61
Button B: X+41, Y+12
Prize: X=8771, Y=12729

Button A: X+71, Y+11
Button B: X+14, Y+54
Prize: X=7189, Y=5889

Button A: X+22, Y+36
Button B: X+49, Y+21
Prize: X=8122, Y=6806

Button A: X+44, Y+88
Button B: X+72, Y+36
Prize: X=4972, Y=4004

Button A: X+11, Y+57
Button B: X+50, Y+18
Prize: X=3024, Y=17456

Button A: X+88, Y+91
Button B: X+80, Y+13
Prize: X=12096, Y=8255

Button A: X+22, Y+50
Button B: X+48, Y+28
Prize: X=17238, Y=1530

Button A: X+67, Y+19
Button B: X+25, Y+70
Prize: X=15607, Y=12559

Button A: X+20, Y+58
Button B: X+67, Y+22
Prize: X=13571, Y=12102

Button A: X+36, Y+74
Button B: X+82, Y+39
Prize: X=6484, Y=8146

Button A: X+15, Y+73
Button B: X+89, Y+17
Prize: X=9054, Y=4114

Button A: X+40, Y+23
Button B: X+12, Y+41
Prize: X=10476, Y=1521

Button A: X+61, Y+30
Button B: X+43, Y+71
Prize: X=5659, Y=5525

Button A: X+56, Y+20
Button B: X+36, Y+75
Prize: X=15692, Y=11255

Button A: X+12, Y+54
Button B: X+28, Y+27
Prize: X=540, Y=945

Button A: X+62, Y+18
Button B: X+47, Y+71
Prize: X=8201, Y=6109

Button A: X+55, Y+90
Button B: X+95, Y+35
Prize: X=7345, Y=9610

Button A: X+92, Y+77
Button B: X+26, Y+76
Prize: X=9400, Y=9820

Button A: X+76, Y+75
Button B: X+12, Y+66
Prize: X=2440, Y=5874

Button A: X+82, Y+12
Button B: X+56, Y+95
Prize: X=2336, Y=2946

Button A: X+63, Y+82
Button B: X+72, Y+14
Prize: X=5661, Y=3542

Button A: X+35, Y+72
Button B: X+57, Y+14
Prize: X=17617, Y=5546

Button A: X+80, Y+24
Button B: X+33, Y+89
Prize: X=8581, Y=5501

Button A: X+68, Y+37
Button B: X+42, Y+88
Prize: X=7270, Y=5845

Button A: X+12, Y+52
Button B: X+34, Y+12
Prize: X=7922, Y=17576

Button A: X+61, Y+74
Button B: X+76, Y+23
Prize: X=7511, Y=2884

Button A: X+84, Y+33
Button B: X+12, Y+18
Prize: X=3372, Y=2268

Button A: X+32, Y+68
Button B: X+52, Y+19
Prize: X=3288, Y=3522

Button A: X+18, Y+57
Button B: X+71, Y+15
Prize: X=3948, Y=6983

Button A: X+80, Y+40
Button B: X+23, Y+67
Prize: X=5874, Y=7266

Button A: X+81, Y+53
Button B: X+19, Y+79
Prize: X=3362, Y=4330

Button A: X+37, Y+79
Button B: X+95, Y+26
Prize: X=4045, Y=3862

Button A: X+89, Y+36
Button B: X+58, Y+91
Prize: X=7323, Y=6204

Button A: X+28, Y+23
Button B: X+11, Y+91
Prize: X=1531, Y=7241

Button A: X+28, Y+60
Button B: X+62, Y+20
Prize: X=16504, Y=6340

Button A: X+23, Y+71
Button B: X+94, Y+75
Prize: X=1711, Y=1839

Button A: X+18, Y+54
Button B: X+60, Y+13
Prize: X=6068, Y=16687

Button A: X+11, Y+44
Button B: X+69, Y+23
Prize: X=770, Y=1009

Button A: X+83, Y+60
Button B: X+13, Y+45
Prize: X=3334, Y=3585

Button A: X+30, Y+60
Button B: X+50, Y+13
Prize: X=19290, Y=15493

Button A: X+26, Y+79
Button B: X+94, Y+35
Prize: X=7188, Y=7806

Button A: X+29, Y+60
Button B: X+53, Y+13
Prize: X=11472, Y=418

Button A: X+97, Y+86
Button B: X+13, Y+99
Prize: X=2527, Y=8801

Button A: X+67, Y+99
Button B: X+98, Y+27
Prize: X=3521, Y=3789

Button A: X+55, Y+77
Button B: X+37, Y+15
Prize: X=14225, Y=12883

Button A: X+13, Y+20
Button B: X+41, Y+18
Prize: X=1233, Y=770

Button A: X+97, Y+48
Button B: X+14, Y+57
Prize: X=8380, Y=7752

Button A: X+12, Y+61
Button B: X+69, Y+17
Prize: X=3305, Y=1545

Button A: X+15, Y+56
Button B: X+64, Y+31
Prize: X=3453, Y=3344

Button A: X+45, Y+62
Button B: X+33, Y+12
Prize: X=3635, Y=16852

Button A: X+36, Y+12
Button B: X+12, Y+33
Prize: X=10856, Y=4394

Button A: X+55, Y+89
Button B: X+82, Y+24
Prize: X=3886, Y=2158

Button A: X+26, Y+73
Button B: X+97, Y+68
Prize: X=9733, Y=7097

Button A: X+87, Y+46
Button B: X+11, Y+52
Prize: X=1369, Y=15432

Button A: X+48, Y+20
Button B: X+37, Y+68
Prize: X=12376, Y=4116

Button A: X+34, Y+75
Button B: X+77, Y+31
Prize: X=3397, Y=5966

Button A: X+26, Y+59
Button B: X+35, Y+18
Prize: X=12833, Y=3002

Button A: X+16, Y+65
Button B: X+92, Y+19
Prize: X=4248, Y=3777

Button A: X+65, Y+21
Button B: X+29, Y+68
Prize: X=3813, Y=14170

Button A: X+37, Y+12
Button B: X+28, Y+43
Prize: X=3647, Y=5762

Button A: X+66, Y+28
Button B: X+31, Y+84
Prize: X=2952, Y=4228

Button A: X+48, Y+86
Button B: X+73, Y+31
Prize: X=7120, Y=6370

Button A: X+81, Y+34
Button B: X+50, Y+93
Prize: X=8280, Y=6068

Button A: X+26, Y+50
Button B: X+87, Y+32
Prize: X=4167, Y=1654

Button A: X+19, Y+98
Button B: X+33, Y+19
Prize: X=3742, Y=4331

Button A: X+17, Y+52
Button B: X+61, Y+22
Prize: X=3176, Y=9284

Button A: X+18, Y+41
Button B: X+71, Y+43
Prize: X=8552, Y=2649

Button A: X+51, Y+14
Button B: X+66, Y+89
Prize: X=6510, Y=8450

Button A: X+11, Y+38
Button B: X+58, Y+13
Prize: X=13236, Y=9231

Button A: X+26, Y+15
Button B: X+32, Y+56
Prize: X=13378, Y=1307

Button A: X+48, Y+12
Button B: X+43, Y+77
Prize: X=8151, Y=4369

Button A: X+83, Y+28
Button B: X+19, Y+24
Prize: X=6854, Y=2664

Button A: X+45, Y+53
Button B: X+56, Y+17
Prize: X=8035, Y=5547

Button A: X+57, Y+26
Button B: X+13, Y+24
Prize: X=5477, Y=3456

Button A: X+64, Y+34
Button B: X+20, Y+48
Prize: X=14540, Y=13044

Button A: X+63, Y+39
Button B: X+41, Y+78
Prize: X=5827, Y=6396

Button A: X+75, Y+15
Button B: X+15, Y+71
Prize: X=18125, Y=11885

Button A: X+67, Y+25
Button B: X+57, Y+82
Prize: X=4467, Y=3428

Button A: X+67, Y+19
Button B: X+18, Y+47
Prize: X=11739, Y=7909

Button A: X+11, Y+66
Button B: X+76, Y+13
Prize: X=18011, Y=14042

Button A: X+71, Y+82
Button B: X+78, Y+18
Prize: X=6875, Y=4408

Button A: X+39, Y+52
Button B: X+53, Y+14
Prize: X=4891, Y=2668

Button A: X+44, Y+25
Button B: X+14, Y+44
Prize: X=17914, Y=12221

Button A: X+82, Y+38
Button B: X+46, Y+94
Prize: X=8364, Y=6856

Button A: X+18, Y+59
Button B: X+64, Y+27
Prize: X=16262, Y=18991

Button A: X+55, Y+70
Button B: X+91, Y+11
Prize: X=7510, Y=2745

Button A: X+31, Y+13
Button B: X+11, Y+92
Prize: X=943, Y=6163

Button A: X+42, Y+70
Button B: X+67, Y+26
Prize: X=6861, Y=7066

Button A: X+49, Y+20
Button B: X+14, Y+39
Prize: X=2065, Y=4005

Button A: X+69, Y+11
Button B: X+54, Y+56
Prize: X=5592, Y=1318

Button A: X+69, Y+35
Button B: X+12, Y+44
Prize: X=4697, Y=2487

Button A: X+85, Y+19
Button B: X+41, Y+51
Prize: X=2901, Y=1527

Button A: X+52, Y+14
Button B: X+23, Y+67
Prize: X=16545, Y=3463

Button A: X+43, Y+14
Button B: X+13, Y+61
Prize: X=19114, Y=16830

Button A: X+42, Y+71
Button B: X+93, Y+21
Prize: X=4809, Y=3362

Button A: X+79, Y+34
Button B: X+45, Y+99
Prize: X=8849, Y=9542

Button A: X+62, Y+22
Button B: X+38, Y+57
Prize: X=6450, Y=5770

Button A: X+31, Y+67
Button B: X+83, Y+56
Prize: X=5663, Y=8291

Button A: X+15, Y+50
Button B: X+38, Y+19
Prize: X=3628, Y=7019

Button A: X+83, Y+31
Button B: X+46, Y+56
Prize: X=470, Y=292

Button A: X+19, Y+95
Button B: X+67, Y+15
Prize: X=6784, Y=8960

Button A: X+20, Y+83
Button B: X+29, Y+15
Prize: X=1607, Y=2139

Button A: X+28, Y+52
Button B: X+91, Y+22
Prize: X=1141, Y=502

Button A: X+75, Y+27
Button B: X+45, Y+72
Prize: X=6960, Y=3231

Button A: X+56, Y+76
Button B: X+93, Y+13
Prize: X=12274, Y=7374

Button A: X+86, Y+34
Button B: X+50, Y+65
Prize: X=8286, Y=6804

Button A: X+65, Y+24
Button B: X+14, Y+33
Prize: X=14442, Y=3530

Button A: X+98, Y+33
Button B: X+68, Y+78
Prize: X=9486, Y=4131

Button A: X+37, Y+87
Button B: X+97, Y+39
Prize: X=5839, Y=3141

Button A: X+77, Y+32
Button B: X+30, Y+61
Prize: X=3936, Y=2024

Button A: X+36, Y+18
Button B: X+11, Y+35
Prize: X=8099, Y=8099

Button A: X+96, Y+43
Button B: X+41, Y+83
Prize: X=5305, Y=3475

Button A: X+79, Y+11
Button B: X+32, Y+35
Prize: X=2181, Y=1556

Button A: X+26, Y+60
Button B: X+64, Y+23
Prize: X=3188, Y=11974

Button A: X+42, Y+16
Button B: X+18, Y+61
Prize: X=14534, Y=8311

Button A: X+12, Y+48
Button B: X+79, Y+29
Prize: X=11975, Y=9941

Button A: X+17, Y+54
Button B: X+63, Y+30
Prize: X=2089, Y=10202

Button A: X+62, Y+24
Button B: X+11, Y+35
Prize: X=4439, Y=13677

Button A: X+46, Y+57
Button B: X+55, Y+15
Prize: X=5256, Y=4812

Button A: X+34, Y+17
Button B: X+25, Y+56
Prize: X=10318, Y=7437

Button A: X+19, Y+82
Button B: X+67, Y+47
Prize: X=1736, Y=4102

Button A: X+46, Y+19
Button B: X+35, Y+66
Prize: X=11211, Y=10607

Button A: X+47, Y+64
Button B: X+93, Y+40
Prize: X=11287, Y=7832

Button A: X+70, Y+40
Button B: X+14, Y+81
Prize: X=3332, Y=6868

Button A: X+81, Y+11
Button B: X+11, Y+72
Prize: X=4578, Y=8951

Button A: X+24, Y+52
Button B: X+57, Y+15
Prize: X=18755, Y=16053

Button A: X+95, Y+41
Button B: X+32, Y+83
Prize: X=7637, Y=4403

Button A: X+25, Y+52
Button B: X+59, Y+21
Prize: X=4618, Y=15514

Button A: X+62, Y+24
Button B: X+30, Y+68
Prize: X=5346, Y=1736

Button A: X+14, Y+37
Button B: X+66, Y+37
Prize: X=17488, Y=17306

Button A: X+68, Y+24
Button B: X+69, Y+95
Prize: X=5094, Y=6178

Button A: X+19, Y+29
Button B: X+99, Y+19
Prize: X=1926, Y=826

Button A: X+15, Y+33
Button B: X+63, Y+23
Prize: X=13331, Y=11029

Button A: X+90, Y+12
Button B: X+12, Y+65
Prize: X=6102, Y=5949

Button A: X+31, Y+68
Button B: X+56, Y+12
Prize: X=16228, Y=8080

Button A: X+28, Y+73
Button B: X+57, Y+17
Prize: X=14247, Y=3172

Button A: X+11, Y+26
Button B: X+37, Y+23
Prize: X=13427, Y=7273

Button A: X+41, Y+19
Button B: X+15, Y+73
Prize: X=3548, Y=4088

Button A: X+86, Y+82
Button B: X+24, Y+86
Prize: X=7332, Y=11346

Button A: X+89, Y+24
Button B: X+39, Y+78
Prize: X=6928, Y=4770

Button A: X+31, Y+45
Button B: X+40, Y+14
Prize: X=15091, Y=14401

Button A: X+48, Y+26
Button B: X+16, Y+51
Prize: X=10016, Y=4137

Button A: X+16, Y+45
Button B: X+58, Y+20
Prize: X=14050, Y=5760

Button A: X+15, Y+38
Button B: X+83, Y+26
Prize: X=8740, Y=4636

Button A: X+31, Y+52
Button B: X+36, Y+18
Prize: X=10505, Y=1352

Button A: X+11, Y+29
Button B: X+56, Y+31
Prize: X=3071, Y=15583

Button A: X+41, Y+13
Button B: X+51, Y+84
Prize: X=18140, Y=4034

Button A: X+31, Y+20
Button B: X+11, Y+43
Prize: X=393, Y=828

Button A: X+54, Y+33
Button B: X+20, Y+38
Prize: X=7204, Y=6838

Button A: X+43, Y+65
Button B: X+41, Y+12
Prize: X=12942, Y=5307

Button A: X+45, Y+19
Button B: X+34, Y+69
Prize: X=16741, Y=19477

Button A: X+35, Y+99
Button B: X+95, Y+13
Prize: X=4455, Y=5697

Button A: X+83, Y+88
Button B: X+68, Y+13
Prize: X=8324, Y=7939

Button A: X+60, Y+30
Button B: X+28, Y+47
Prize: X=4808, Y=3262

Button A: X+65, Y+24
Button B: X+23, Y+33
Prize: X=4552, Y=2514

Button A: X+70, Y+11
Button B: X+96, Y+93
Prize: X=9974, Y=7333

Button A: X+69, Y+11
Button B: X+40, Y+95
Prize: X=4751, Y=2264

Button A: X+12, Y+38
Button B: X+41, Y+22
Prize: X=10631, Y=18294

Button A: X+17, Y+46
Button B: X+77, Y+50
Prize: X=4969, Y=842

Button A: X+29, Y+72
Button B: X+37, Y+14
Prize: X=9755, Y=16850

Button A: X+24, Y+13
Button B: X+12, Y+28
Prize: X=416, Y=276

Button A: X+19, Y+46
Button B: X+63, Y+29
Prize: X=4385, Y=4440

Button A: X+31, Y+71
Button B: X+45, Y+13
Prize: X=12901, Y=16461

Button A: X+54, Y+12
Button B: X+11, Y+30
Prize: X=3603, Y=9422

Button A: X+75, Y+14
Button B: X+75, Y+89
Prize: X=8475, Y=4057

Button A: X+28, Y+57
Button B: X+59, Y+26
Prize: X=920, Y=7915

Button A: X+75, Y+67
Button B: X+66, Y+11
Prize: X=1692, Y=936

Button A: X+49, Y+30
Button B: X+16, Y+39
Prize: X=4870, Y=1706

Button A: X+99, Y+15
Button B: X+68, Y+64
Prize: X=6419, Y=4087

Button A: X+58, Y+33
Button B: X+15, Y+31
Prize: X=8796, Y=12658

Button A: X+31, Y+11
Button B: X+11, Y+42
Prize: X=3154, Y=3600

Button A: X+29, Y+75
Button B: X+57, Y+27
Prize: X=5986, Y=6450

Button A: X+14, Y+78
Button B: X+82, Y+13
Prize: X=4116, Y=1183

Button A: X+66, Y+27
Button B: X+27, Y+69
Prize: X=19682, Y=16529

Button A: X+53, Y+21
Button B: X+35, Y+73
Prize: X=8143, Y=1011

Button A: X+32, Y+75
Button B: X+63, Y+17
Prize: X=7327, Y=6707

Button A: X+14, Y+30
Button B: X+48, Y+24
Prize: X=5018, Y=8378

Button A: X+18, Y+43
Button B: X+51, Y+20
Prize: X=434, Y=12521

Button A: X+99, Y+34
Button B: X+18, Y+27
Prize: X=1998, Y=936

Button A: X+68, Y+93
Button B: X+83, Y+30
Prize: X=1759, Y=1320

Button A: X+28, Y+94
Button B: X+62, Y+26
Prize: X=1226, Y=1748

Button A: X+91, Y+97
Button B: X+62, Y+15
Prize: X=5863, Y=3593

Button A: X+23, Y+98
Button B: X+51, Y+53
Prize: X=5031, Y=8785

Button A: X+21, Y+58
Button B: X+33, Y+17
Prize: X=12344, Y=6367

Button A: X+34, Y+45
Button B: X+92, Y+32
Prize: X=11180, Y=6808

Button A: X+35, Y+61
Button B: X+33, Y+19
Prize: X=15940, Y=2128

Button A: X+38, Y+84
Button B: X+96, Y+64
Prize: X=5812, Y=4696

Button A: X+12, Y+25
Button B: X+65, Y+42
Prize: X=2461, Y=8045

Button A: X+12, Y+40
Button B: X+88, Y+14
Prize: X=3308, Y=2926

Button A: X+12, Y+54
Button B: X+51, Y+23
Prize: X=14201, Y=8713

Button A: X+65, Y+18
Button B: X+68, Y+78
Prize: X=7951, Y=6462

Button A: X+24, Y+70
Button B: X+44, Y+20
Prize: X=1548, Y=2890

Button A: X+48, Y+16
Button B: X+18, Y+44
Prize: X=2616, Y=1936

Button A: X+15, Y+59
Button B: X+35, Y+16
Prize: X=19690, Y=12959

Button A: X+69, Y+35
Button B: X+30, Y+60
Prize: X=7314, Y=6800

Button A: X+21, Y+47
Button B: X+42, Y+20
Prize: X=1323, Y=2369

Button A: X+73, Y+22
Button B: X+18, Y+75
Prize: X=5427, Y=4836

Button A: X+28, Y+47
Button B: X+54, Y+26
Prize: X=10854, Y=13281

Button A: X+58, Y+26
Button B: X+34, Y+56
Prize: X=2032, Y=1400

Button A: X+61, Y+25
Button B: X+16, Y+63
Prize: X=10391, Y=11345

Button A: X+16, Y+60
Button B: X+59, Y+12
Prize: X=2329, Y=3084

Button A: X+55, Y+95
Button B: X+89, Y+40
Prize: X=11067, Y=10245

Button A: X+97, Y+78
Button B: X+12, Y+71
Prize: X=4529, Y=6464

Button A: X+55, Y+30
Button B: X+24, Y+42
Prize: X=3198, Y=2814

Button A: X+35, Y+16
Button B: X+32, Y+59
Prize: X=15670, Y=4203

Button A: X+11, Y+70
Button B: X+28, Y+23
Prize: X=1317, Y=5898

Button A: X+22, Y+70
Button B: X+57, Y+16
Prize: X=9258, Y=6964

Button A: X+83, Y+24
Button B: X+11, Y+50
Prize: X=4268, Y=6110

Button A: X+70, Y+31
Button B: X+19, Y+44
Prize: X=6967, Y=3548

Button A: X+35, Y+19
Button B: X+18, Y+40
Prize: X=9813, Y=3563

Button A: X+74, Y+27
Button B: X+11, Y+41
Prize: X=13301, Y=7703

Button A: X+39, Y+63
Button B: X+94, Y+48
Prize: X=2328, Y=2826

Button A: X+80, Y+41
Button B: X+37, Y+58
Prize: X=5670, Y=4077

Button A: X+18, Y+61
Button B: X+43, Y+20
Prize: X=8795, Y=2378

Button A: X+66, Y+15
Button B: X+30, Y+77
Prize: X=3692, Y=10594

Button A: X+95, Y+32
Button B: X+29, Y+97
Prize: X=7282, Y=6640

Button A: X+59, Y+16
Button B: X+20, Y+78
Prize: X=13817, Y=10588

Button A: X+13, Y+37
Button B: X+68, Y+34
Prize: X=13597, Y=13005

Button A: X+52, Y+69
Button B: X+31, Y+11
Prize: X=13920, Y=5428

Button A: X+69, Y+24
Button B: X+21, Y+95
Prize: X=6510, Y=3229

Button A: X+78, Y+11
Button B: X+25, Y+29
Prize: X=4786, Y=2611

Button A: X+61, Y+31
Button B: X+11, Y+24
Prize: X=6224, Y=17190

Button A: X+83, Y+45
Button B: X+11, Y+45
Prize: X=1841, Y=12815

Button A: X+15, Y+60
Button B: X+70, Y+26
Prize: X=4740, Y=2196

Button A: X+43, Y+56
Button B: X+12, Y+97
Prize: X=612, Y=1448

Button A: X+61, Y+24
Button B: X+17, Y+45
Prize: X=16094, Y=7139

Button A: X+18, Y+97
Button B: X+86, Y+99
Prize: X=6182, Y=11083

Button A: X+72, Y+43
Button B: X+24, Y+51
Prize: X=13880, Y=13295

Button A: X+11, Y+26
Button B: X+39, Y+11
Prize: X=13186, Y=8851

Button A: X+54, Y+23
Button B: X+30, Y+86
Prize: X=3120, Y=8285

Button A: X+57, Y+12
Button B: X+23, Y+72
Prize: X=4104, Y=8240

Button A: X+26, Y+57
Button B: X+69, Y+34
Prize: X=2787, Y=1771

Button A: X+14, Y+46
Button B: X+65, Y+15
Prize: X=9516, Y=14004

Button A: X+60, Y+34
Button B: X+12, Y+34
Prize: X=2324, Y=5446

Button A: X+61, Y+14
Button B: X+87, Y+95
Prize: X=7400, Y=5450

Button A: X+21, Y+81
Button B: X+87, Y+77
Prize: X=2283, Y=7513

Button A: X+26, Y+19
Button B: X+14, Y+74
Prize: X=2304, Y=6020

Button A: X+35, Y+95
Button B: X+85, Y+28
Prize: X=6855, Y=8268

Button A: X+80, Y+21
Button B: X+15, Y+65
Prize: X=4410, Y=4455

Button A: X+63, Y+35
Button B: X+11, Y+49
Prize: X=18924, Y=298

Button A: X+33, Y+59
Button B: X+32, Y+13
Prize: X=1592, Y=12836

Button A: X+49, Y+12
Button B: X+21, Y+65
Prize: X=8831, Y=10539

Button A: X+48, Y+66
Button B: X+52, Y+15
Prize: X=5732, Y=3531

Button A: X+41, Y+11
Button B: X+13, Y+59
Prize: X=9307, Y=17229

Button A: X+14, Y+68
Button B: X+78, Y+28
Prize: X=17738, Y=1668

Button A: X+49, Y+24
Button B: X+31, Y+53
Prize: X=10437, Y=11055

Button A: X+36, Y+84
Button B: X+35, Y+13
Prize: X=5863, Y=8393

Button A: X+12, Y+88
Button B: X+83, Y+17
Prize: X=9010, Y=8090

Button A: X+13, Y+56
Button B: X+26, Y+26
Prize: X=2002, Y=3894

Button A: X+65, Y+32
Button B: X+32, Y+57
Prize: X=1261, Y=1157

Button A: X+30, Y+64
Button B: X+50, Y+17
Prize: X=12250, Y=9241

Button A: X+66, Y+16
Button B: X+18, Y+65
Prize: X=5264, Y=9075

Button A: X+21, Y+35
Button B: X+35, Y+17
Prize: X=2349, Y=12167

Button A: X+60, Y+13
Button B: X+26, Y+81
Prize: X=12004, Y=15967

Button A: X+69, Y+11
Button B: X+20, Y+72
Prize: X=9957, Y=11299

Button A: X+85, Y+36
Button B: X+54, Y+95
Prize: X=6123, Y=6344

Button A: X+68, Y+18
Button B: X+24, Y+83
Prize: X=2252, Y=2359

Button A: X+26, Y+82
Button B: X+89, Y+55
Prize: X=3463, Y=7085

Button A: X+47, Y+18
Button B: X+14, Y+25
Prize: X=17934, Y=10126

Button A: X+11, Y+35
Button B: X+48, Y+22
Prize: X=13363, Y=15897

Button A: X+15, Y+48
Button B: X+53, Y+41
Prize: X=1982, Y=1970

Button A: X+44, Y+95
Button B: X+87, Y+42
Prize: X=6296, Y=7760

Button A: X+48, Y+78
Button B: X+36, Y+12
Prize: X=2960, Y=11996

Button A: X+61, Y+25
Button B: X+20, Y+59
Prize: X=3205, Y=7852

Button A: X+70, Y+14
Button B: X+40, Y+63
Prize: X=5280, Y=5621

Button A: X+36, Y+89
Button B: X+78, Y+14
Prize: X=7998, Y=3499

Button A: X+44, Y+13
Button B: X+36, Y+62
Prize: X=12436, Y=18317

Button A: X+94, Y+32
Button B: X+38, Y+84
Prize: X=7058, Y=7164

Button A: X+11, Y+51
Button B: X+76, Y+29
Prize: X=1478, Y=4057

Button A: X+12, Y+86
Button B: X+27, Y+18
Prize: X=2028, Y=6110

Button A: X+46, Y+76
Button B: X+78, Y+25
Prize: X=5320, Y=5258

Button A: X+11, Y+49
Button B: X+83, Y+46
Prize: X=14490, Y=697

Button A: X+43, Y+12
Button B: X+15, Y+31
Prize: X=3726, Y=5789

Button A: X+19, Y+73
Button B: X+74, Y+11
Prize: X=4904, Y=14462

Button A: X+42, Y+79
Button B: X+49, Y+15
Prize: X=6437, Y=10779

Button A: X+48, Y+73
Button B: X+68, Y+11
Prize: X=5900, Y=4999

Button A: X+39, Y+33
Button B: X+21, Y+75
Prize: X=1467, Y=2901

Button A: X+14, Y+47
Button B: X+74, Y+22
Prize: X=8702, Y=7531

Button A: X+69, Y+33
Button B: X+17, Y+43
Prize: X=12146, Y=18812

Button A: X+34, Y+57
Button B: X+80, Y+44
Prize: X=5908, Y=6390

Button A: X+15, Y+38
Button B: X+64, Y+44
Prize: X=5357, Y=17838

Button A: X+22, Y+51
Button B: X+68, Y+43
Prize: X=626, Y=878

Button A: X+80, Y+25
Button B: X+69, Y+75
Prize: X=4683, Y=3975

Button A: X+19, Y+94
Button B: X+95, Y+33
Prize: X=6574, Y=10674

Button A: X+81, Y+59
Button B: X+34, Y+90
Prize: X=4542, Y=4874

Button A: X+86, Y+29
Button B: X+11, Y+92
Prize: X=8108, Y=11210

Button A: X+41, Y+24
Button B: X+19, Y+40
Prize: X=13789, Y=19736

Button A: X+57, Y+28
Button B: X+15, Y+41
Prize: X=6077, Y=6618

Button A: X+28, Y+21
Button B: X+23, Y+74
Prize: X=2806, Y=5850

Button A: X+55, Y+24
Button B: X+16, Y+35
Prize: X=14348, Y=15869

Button A: X+70, Y+42
Button B: X+42, Y+85
Prize: X=6426, Y=6726

Button A: X+77, Y+93
Button B: X+74, Y+17
Prize: X=5480, Y=3217

Button A: X+74, Y+74
Button B: X+25, Y+97
Prize: X=6236, Y=10556

Button A: X+69, Y+35
Button B: X+13, Y+33
Prize: X=10810, Y=12644

Button A: X+36, Y+17
Button B: X+19, Y+28
Prize: X=4740, Y=11415

Button A: X+30, Y+72
Button B: X+63, Y+15
Prize: X=14639, Y=16241

Button A: X+15, Y+60
Button B: X+53, Y+25
Prize: X=4397, Y=2815

Button A: X+16, Y+69
Button B: X+54, Y+13
Prize: X=12510, Y=11763

Button A: X+41, Y+27
Button B: X+13, Y+31
Prize: X=7962, Y=11134

Button A: X+11, Y+46
Button B: X+38, Y+22
Prize: X=1778, Y=4834

Button A: X+40, Y+85
Button B: X+27, Y+18
Prize: X=3222, Y=4248

Button A: X+51, Y+17
Button B: X+37, Y+77
Prize: X=14542, Y=17706

Button A: X+71, Y+11
Button B: X+41, Y+95
Prize: X=6029, Y=5987

Button A: X+24, Y+14
Button B: X+23, Y+42
Prize: X=1959, Y=1400

Button A: X+51, Y+21
Button B: X+14, Y+80
Prize: X=3361, Y=8659

Button A: X+70, Y+33
Button B: X+16, Y+64
Prize: X=6666, Y=5175

Button A: X+17, Y+43
Button B: X+84, Y+14
Prize: X=1396, Y=554

Button A: X+76, Y+35
Button B: X+22, Y+88
Prize: X=9428, Y=11350

Button A: X+54, Y+13
Button B: X+14, Y+62
Prize: X=6876, Y=18546

Button A: X+55, Y+29
Button B: X+24, Y+40
Prize: X=6663, Y=6029

Button A: X+55, Y+49
Button B: X+11, Y+52
Prize: X=2167, Y=5813

Button A: X+27, Y+13
Button B: X+26, Y+42
Prize: X=16846, Y=4546

Button A: X+60, Y+16
Button B: X+32, Y+75
Prize: X=2660, Y=5362

Button A: X+36, Y+69
Button B: X+64, Y+39
Prize: X=4668, Y=4680

Button A: X+38, Y+12
Button B: X+28, Y+56
Prize: X=2180, Y=1160

Button A: X+31, Y+21
Button B: X+30, Y+65
Prize: X=4857, Y=6507

Button A: X+38, Y+56
Button B: X+38, Y+15
Prize: X=13686, Y=14581

Button A: X+25, Y+57
Button B: X+40, Y+17
Prize: X=11305, Y=8893

Button A: X+13, Y+45
Button B: X+52, Y+46
Prize: X=5395, Y=5811