Complete day 14

This commit is contained in:
2024-12-21 12:17:23 -05:00
parent c02dc3ce44
commit aed569d950
4 changed files with 781 additions and 1 deletions

View File

@@ -26,6 +26,8 @@ import com.mattrixwv.adventOfCode24.days.Problem23;
import com.mattrixwv.adventOfCode24.days.Problem24;
import com.mattrixwv.adventOfCode24.days.Problem25;
import com.mattrixwv.adventOfCode24.days.Problem26;
import com.mattrixwv.adventOfCode24.days.Problem27;
import com.mattrixwv.adventOfCode24.days.Problem28;
import com.mattrixwv.adventOfCode24.days.Problem3;
import com.mattrixwv.adventOfCode24.days.Problem4;
import com.mattrixwv.adventOfCode24.days.Problem5;
@@ -41,7 +43,7 @@ public class ProblemSelector{
protected static final List<Integer> PROBLEM_NUMBERS = List.of(
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26
20, 21, 22, 23, 24, 25, 26, 27, 28
);
@@ -80,6 +82,8 @@ public class ProblemSelector{
case 24 : day = new Problem24(); break;
case 25 : day = new Problem25(); break;
case 26 : day = new Problem26(); break;
case 27 : day = new Problem27(); break;
case 28 : day = new Problem28(); break;
default: throw new InvalidParameterException();
}
return day;

View File

@@ -0,0 +1,137 @@
package com.mattrixwv.adventOfCode24.days;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import com.mattrixwv.Stopwatch;
import com.mattrixwv.Triple;
public class Problem27 extends Problem{
private static final String inputFileName = "days/Problem27.txt";
private static final int HEIGHT = 103;
private static final int WIDTH = 101;
private static final int MOVEMENTS = 100;
//private static final int HEIGHT = 7;
//private static final int WIDTH = 11;
//private static final int MOVEMENTS = 100;
//locations = <location, velocity, null>
//location = x, y, null
//velocity = x, y, null
private List<Triple<Triple<Integer, Integer, Integer>, Triple<Integer, Integer, Integer>, Integer>> robotPositions;
public Problem27(){
super();
description = "Find the safety factor after the specified number of movements.";
result = "Unresolved";
}
public String runSolution(){
Stopwatch timer = new Stopwatch();
timer.start();
//Read the file
robotPositions = new ArrayList<>();
try(Scanner scanner = new Scanner(this.getClass().getClassLoader().getResourceAsStream(inputFileName))){
scanner.useDelimiter("\n");
while(scanner.hasNext()){
String robotParams = scanner.next();
if(!robotParams.isBlank()){
String[] params = robotParams.split(" ");
String positionParams = params[0].split("p=")[1];
String velocityParams = params[1].split("v=")[1];
int xPosition = Integer.parseInt(positionParams.split(",")[0]);
int yPosition = Integer.parseInt(positionParams.split(",")[1]);
int xMovement = Integer.parseInt(velocityParams.split(",")[0]);
int yMovement = Integer.parseInt(velocityParams.split(",")[1]);
Triple<Triple<Integer, Integer, Integer>, Triple<Integer, Integer, Integer>, Integer> robotPosition = new Triple<>(new Triple<>(xPosition, yPosition, 1), new Triple<>(xMovement, yMovement, 1), 1);
robotPositions.add(robotPosition);
}
}
}
List<Triple<Triple<Integer, Integer, Integer>, Triple<Integer, Integer, Integer>, Integer>> newRobotPositions = new ArrayList<>();
for(Triple<Triple<Integer, Integer, Integer>, Triple<Integer, Integer, Integer>, Integer> robotPosition : robotPositions){
Triple<Triple<Integer, Integer, Integer>, Triple<Integer, Integer, Integer>, Integer> newRobotPosition = moveRobot(robotPosition, MOVEMENTS);
newRobotPositions.add(newRobotPosition);
}
int safetyFactor = calcSafetyFactor(newRobotPositions);
//Save the result
timer.stop();
result = "The safety factor is " + safetyFactor + ".\nIt took " + timer.toString() + " to run this algorithm.";
return result;
}
//locations = <location, velocity, null>
//location = x, y, null
//velocity = x, y, null
private Triple<Triple<Integer, Integer, Integer>, Triple<Integer, Integer, Integer>, Integer> moveRobot(Triple<Triple<Integer, Integer, Integer>, Triple<Integer, Integer, Integer>, Integer> robotPosition, int movements){
//Get the variables we need
final int xLoc = robotPosition.getA().getA();
final int yLoc = robotPosition.getA().getB();
final int xMove = robotPosition.getB().getA();
final int yMove = robotPosition.getB().getB();
//Get the new positions
int newXLoc = xLoc + (xMove * movements);
int newYLoc = yLoc + (yMove * movements);
//Normalize the positions within the grid
newXLoc %= WIDTH;
newXLoc = (newXLoc >= 0) ? newXLoc : newXLoc + WIDTH;
newYLoc %= HEIGHT;
newYLoc = (newYLoc >= 0) ? newYLoc : newYLoc + HEIGHT;
return new Triple<>(new Triple<>(newXLoc, newYLoc, 1), robotPosition.getB(), robotPosition.getC());
}
private int calcSafetyFactor(List<Triple<Triple<Integer, Integer, Integer>, Triple<Integer, Integer, Integer>, Integer>> robotPositions){
int ulQuad = 0;
int urQuad = 0;
int llQuad = 0;
int lrQuad = 0;
final int xMiddle = Math.floorDiv(WIDTH, 2);
final int yMiddle = Math.floorDiv(HEIGHT, 2);
for(Triple<Triple<Integer, Integer, Integer>, Triple<Integer, Integer, Integer>, Integer> pos : robotPositions){
final int xLoc = pos.getA().getA();
final int yLoc = pos.getA().getB();
final boolean lowX = xLoc < xMiddle;
final boolean highX = xLoc > xMiddle;
final boolean lowY = yLoc < yMiddle;
final boolean highY = yLoc > yMiddle;
//Check UL Quad
if(lowX && lowY){
++ulQuad;
}
//Check UR Quad
else if(highX && lowY){
++urQuad;
}
//Check LL Quad
else if(lowX && highY){
++llQuad;
}
//Check LR Quad
else if(highX && highY){
++lrQuad;
}
}
return ulQuad * urQuad * llQuad * lrQuad;
}
}
/*
Find the safety factor after the specified number of movements.
The safety factor is 230461440.
It took 13.987 milliseconds to run this algorithm.
*/

View File

@@ -0,0 +1,139 @@
package com.mattrixwv.adventOfCode24.days;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import com.mattrixwv.Stopwatch;
import com.mattrixwv.Triple;
public class Problem28 extends Problem{
private static final String inputFileName = "days/Problem27.txt";
private static final int HEIGHT = 103;
private static final int WIDTH = 101;
private List<Triple<Triple<Integer, Integer, Integer>, Triple<Integer, Integer, Integer>, Integer>> robotPositions;
public Problem28(){
super();
description = "Find the number of steps needed for the robots to display a Christmas tree.";
result = "Unresolved";
}
public String runSolution(){
Stopwatch timer = new Stopwatch();
timer.start();
//Read the file
robotPositions = new ArrayList<>();
try(Scanner scanner = new Scanner(this.getClass().getClassLoader().getResourceAsStream(inputFileName))){
scanner.useDelimiter("\n");
while(scanner.hasNext()){
String robotParams = scanner.next();
if(!robotParams.isBlank()){
String[] params = robotParams.split(" ");
String positionParams = params[0].split("p=")[1];
String velocityParams = params[1].split("v=")[1];
int xPosition = Integer.parseInt(positionParams.split(",")[0]);
int yPosition = Integer.parseInt(positionParams.split(",")[1]);
int xMovement = Integer.parseInt(velocityParams.split(",")[0]);
int yMovement = Integer.parseInt(velocityParams.split(",")[1]);
Triple<Triple<Integer, Integer, Integer>, Triple<Integer, Integer, Integer>, Integer> robotPosition = new Triple<>(new Triple<>(xPosition, yPosition, 1), new Triple<>(xMovement, yMovement, 1), 1);
robotPositions.add(robotPosition);
}
}
}
int steps = 0;
boolean christmasTree = false;
while(!christmasTree && steps < 10000){
if(steps % 1000 == 0){
//System.out.println("step = " + steps);
}
List<Triple<Triple<Integer, Integer, Integer>, Triple<Integer, Integer, Integer>, Integer>> newRobotPositions = new ArrayList<>();
for(Triple<Triple<Integer, Integer, Integer>, Triple<Integer, Integer, Integer>, Integer> robotPosition : robotPositions){
Triple<Triple<Integer, Integer, Integer>, Triple<Integer, Integer, Integer>, Integer> newRobotPosition = moveRobot(robotPosition, 1);
newRobotPositions.add(newRobotPosition);
}
++steps;
robotPositions = newRobotPositions;
christmasTree = isChristmasTree(newRobotPositions);
}
//Save the result
timer.stop();
result = "The number of steps needed for the robots to make a Christmas tree is " + steps + ".\nIt took " + timer.toString() + " to run this algorithm.";
return result;
}
private Triple<Triple<Integer, Integer, Integer>, Triple<Integer, Integer, Integer>, Integer> moveRobot(Triple<Triple<Integer, Integer, Integer>, Triple<Integer, Integer, Integer>, Integer> robotPosition, int movements){
//Get the variables we need
final int xLoc = robotPosition.getA().getA();
final int yLoc = robotPosition.getA().getB();
final int xMove = robotPosition.getB().getA();
final int yMove = robotPosition.getB().getB();
//Get the new positions
int newXLoc = xLoc + (xMove * movements);
int newYLoc = yLoc + (yMove * movements);
//Normalize the positions within the grid
newXLoc %= WIDTH;
newXLoc = (newXLoc >= 0) ? newXLoc : newXLoc + WIDTH;
newYLoc %= HEIGHT;
newYLoc = (newYLoc >= 0) ? newYLoc : newYLoc + HEIGHT;
return new Triple<>(new Triple<>(newXLoc, newYLoc, 1), robotPosition.getB(), robotPosition.getC());
}
private boolean isChristmasTree(List<Triple<Triple<Integer, Integer, Integer>, Triple<Integer, Integer, Integer>, Integer>> robotLocs){
List<Triple<Integer, Integer, Integer>> locs = new ArrayList<>();
for(Triple<Triple<Integer, Integer, Integer>, Triple<Integer, Integer, Integer>, Integer> loc : robotLocs){
locs.add(loc.getA());
}
for(Triple<Integer, Integer, Integer> loc : locs){
int cnt = 1;
while(cnt < 31){
if(locs.contains(new Triple<>(loc.getA() + cnt, loc.getB(), loc.getC()))){
++cnt;
}
else{
break;
}
}
if(cnt >= 31){
return true;
}
}
return false;
}
/*
private String printGrid(List<Triple<Triple<Integer, Integer, Integer>, Triple<Integer, Integer, Integer>, Integer>> robotLocs){
StringBuilder[] grid = new StringBuilder[HEIGHT];
for(int cnt = 0;cnt < HEIGHT;++cnt){
grid[cnt] = new StringBuilder(".....................................................................................................");
}
for(Triple<Triple<Integer, Integer, Integer>, Triple<Integer, Integer, Integer>, Integer> loc : robotLocs){
grid[loc.getA().getB()].setCharAt(loc.getA().getA(), 'X');
}
StringJoiner joiner = new StringJoiner("\n");
for(StringBuilder line : grid){
joiner.add(line.toString());
}
return joiner.toString();
}
*/
}
/*
Find the number of steps needed for the robots to display a Christmas tree.
The number of steps needed for the robots to make a Christmas tree is 6668.
It took 1.696 seconds to run this algorithm.
*/

View File

@@ -0,0 +1,500 @@
p=31,100 v=-36,-71
p=29,22 v=9,29
p=26,16 v=-32,-28
p=89,102 v=-63,35
p=84,78 v=-59,-49
p=28,66 v=-87,81
p=34,58 v=-29,-17
p=13,20 v=26,37
p=11,29 v=23,-9
p=32,3 v=-17,36
p=7,54 v=-75,65
p=58,68 v=-56,-76
p=69,9 v=4,-39
p=11,51 v=-68,84
p=82,73 v=-60,-38
p=86,58 v=-99,-15
p=59,40 v=58,19
p=99,66 v=27,82
p=14,60 v=25,88
p=50,24 v=56,22
p=3,24 v=62,-75
p=94,73 v=-62,-76
p=32,66 v=58,-87
p=51,19 v=-46,90
p=4,27 v=27,86
p=5,33 v=30,-96
p=90,83 v=-8,-34
p=34,29 v=-29,-51
p=69,93 v=-4,-52
p=2,96 v=-34,-31
p=3,12 v=-79,86
p=86,87 v=-16,39
p=15,27 v=31,-1
p=74,73 v=41,-42
p=55,10 v=51,40
p=65,32 v=99,-47
p=39,5 v=-90,32
p=68,65 v=51,-64
p=81,11 v=99,36
p=31,28 v=-93,71
p=50,31 v=20,-64
p=52,67 v=-94,-11
p=35,2 v=-34,13
p=53,88 v=-89,-48
p=20,88 v=-61,-83
p=95,86 v=32,-18
p=85,11 v=-34,4
p=19,78 v=72,-49
p=91,27 v=86,41
p=11,14 v=-12,-18
p=90,57 v=87,80
p=70,11 v=-47,-74
p=49,91 v=10,43
p=91,60 v=28,67
p=78,91 v=-94,43
p=44,57 v=-92,38
p=22,42 v=50,59
p=25,33 v=-75,-66
p=97,81 v=-25,62
p=84,64 v=91,-72
p=98,48 v=84,-8
p=54,63 v=-44,27
p=61,69 v=-86,-99
p=47,72 v=20,-22
p=100,7 v=-22,-63
p=95,26 v=38,23
p=67,27 v=-50,18
p=10,98 v=84,-71
p=59,13 v=16,-61
p=14,45 v=71,-58
p=11,81 v=-26,66
p=29,72 v=-39,46
p=2,24 v=-80,-94
p=79,95 v=-9,-37
p=47,86 v=-86,-41
p=9,92 v=24,-14
p=18,69 v=-4,45
p=49,3 v=14,-71
p=90,0 v=-64,-44
p=75,79 v=96,-83
p=82,27 v=41,-70
p=92,85 v=66,71
p=5,57 v=-80,31
p=92,21 v=-15,41
p=91,43 v=88,-66
p=62,7 v=58,-52
p=87,23 v=89,-97
p=54,56 v=62,27
p=29,65 v=-36,-34
p=84,72 v=36,27
p=29,36 v=17,41
p=47,49 v=-92,-46
p=20,81 v=36,-80
p=12,42 v=27,46
p=87,58 v=88,38
p=96,25 v=-20,-70
p=44,72 v=-4,24
p=59,83 v=-99,35
p=31,74 v=-32,5
p=7,10 v=20,-30
p=43,44 v=84,-53
p=24,32 v=-33,-81
p=26,80 v=-82,73
p=99,95 v=-98,44
p=22,73 v=-49,54
p=96,48 v=79,41
p=85,21 v=42,48
p=53,72 v=-42,-53
p=58,35 v=-38,41
p=13,41 v=-53,86
p=57,12 v=-46,-21
p=21,28 v=19,-78
p=59,32 v=1,7
p=12,24 v=-27,10
p=9,101 v=-36,-60
p=6,22 v=-24,-94
p=31,67 v=-93,-65
p=84,1 v=92,24
p=24,55 v=68,-50
p=93,86 v=78,96
p=85,65 v=-14,-99
p=14,96 v=29,-3
p=30,20 v=57,-57
p=70,80 v=46,43
p=49,39 v=-45,95
p=33,42 v=-20,11
p=24,6 v=-1,69
p=2,90 v=29,-14
p=75,6 v=51,28
p=29,88 v=-92,58
p=72,24 v=44,88
p=78,63 v=-56,-45
p=84,35 v=95,-68
p=29,97 v=90,-94
p=97,1 v=28,-74
p=70,34 v=-31,71
p=79,52 v=43,84
p=67,93 v=-51,-75
p=55,84 v=11,-29
p=85,48 v=-66,-35
p=34,82 v=-87,-64
p=21,89 v=-29,-41
p=81,89 v=25,-55
p=87,22 v=-12,25
p=75,41 v=-60,-39
p=22,100 v=-32,-52
p=81,19 v=-14,-54
p=76,95 v=-11,-14
p=87,45 v=39,-88
p=95,77 v=-66,96
p=41,25 v=-40,2
p=37,99 v=63,-75
p=22,50 v=-68,8
p=57,39 v=32,-39
p=73,81 v=-17,43
p=50,58 v=-97,38
p=3,78 v=-17,-30
p=39,76 v=10,-91
p=95,67 v=79,-18
p=13,6 v=-76,40
p=93,21 v=-96,-2
p=67,72 v=-50,-53
p=88,64 v=-61,-84
p=30,20 v=40,-59
p=77,83 v=94,-7
p=41,71 v=10,58
p=88,12 v=43,74
p=49,88 v=-97,20
p=22,9 v=-26,1
p=37,86 v=-37,58
p=91,77 v=78,-14
p=44,79 v=7,16
p=25,26 v=68,37
p=52,41 v=7,-16
p=53,19 v=12,33
p=50,66 v=52,25
p=40,65 v=61,-69
p=8,13 v=26,2
p=9,79 v=77,-41
p=20,14 v=21,21
p=40,97 v=12,-44
p=8,43 v=-71,2
p=5,45 v=-80,49
p=90,81 v=69,-86
p=60,33 v=-56,-69
p=14,48 v=-75,-96
p=26,18 v=62,30
p=47,37 v=-78,59
p=56,4 v=-97,-51
p=67,8 v=47,9
p=74,47 v=-65,77
p=12,47 v=75,-77
p=17,66 v=72,12
p=77,34 v=29,11
p=77,90 v=91,-44
p=0,52 v=6,-68
p=25,97 v=73,5
p=61,30 v=19,-69
p=52,2 v=54,-29
p=40,12 v=-45,-75
p=65,96 v=92,5
p=73,39 v=-56,11
p=17,98 v=25,-75
p=15,16 v=-25,-28
p=5,97 v=-78,-59
p=54,100 v=-47,78
p=18,61 v=-79,-15
p=51,37 v=50,-4
p=92,16 v=78,99
p=70,74 v=-55,-99
p=82,44 v=48,-19
p=20,95 v=-83,-10
p=52,59 v=-43,99
p=49,51 v=-78,8
p=31,24 v=49,61
p=9,73 v=46,4
p=64,52 v=50,-92
p=51,45 v=-49,-16
p=83,60 v=47,-68
p=8,44 v=68,85
p=81,98 v=45,5
p=51,77 v=59,-11
p=40,66 v=-71,-89
p=8,21 v=-16,18
p=9,51 v=33,64
p=59,32 v=99,37
p=46,83 v=-66,-56
p=53,36 v=5,83
p=48,84 v=-48,77
p=19,57 v=-81,-23
p=73,82 v=-26,7
p=21,7 v=-88,-28
p=49,92 v=-87,-26
p=5,59 v=-82,-18
p=84,6 v=-69,-13
p=34,90 v=-87,-44
p=6,79 v=-40,-97
p=42,69 v=-88,88
p=95,53 v=84,30
p=33,86 v=-18,-19
p=77,98 v=-10,70
p=87,98 v=96,82
p=16,13 v=73,-17
p=85,57 v=88,-27
p=24,99 v=-85,-14
p=98,36 v=-61,-1
p=60,58 v=3,42
p=5,56 v=-58,85
p=24,92 v=18,-94
p=82,87 v=-10,-87
p=69,32 v=51,95
p=63,51 v=-52,15
p=44,21 v=51,32
p=83,2 v=-21,-64
p=79,38 v=85,-43
p=53,44 v=-98,-31
p=41,42 v=-83,26
p=36,59 v=-38,-61
p=6,62 v=81,-23
p=57,68 v=40,-71
p=25,101 v=-1,-66
p=53,35 v=38,39
p=74,10 v=61,53
p=83,90 v=83,-29
p=81,13 v=-59,-74
p=25,0 v=26,5
p=19,42 v=99,-50
p=84,75 v=-58,8
p=99,83 v=85,-34
p=55,19 v=-26,-78
p=84,44 v=-11,72
p=82,60 v=-13,-60
p=30,23 v=67,26
p=52,57 v=-89,-83
p=88,35 v=84,-93
p=40,10 v=-45,-10
p=72,26 v=-51,44
p=76,19 v=-50,48
p=81,52 v=38,-8
p=26,35 v=-95,-68
p=52,63 v=-54,35
p=16,11 v=-77,6
p=99,69 v=70,-97
p=53,6 v=85,44
p=73,12 v=-99,-29
p=3,86 v=-93,-64
p=46,18 v=12,-86
p=74,0 v=-59,13
p=25,95 v=67,63
p=71,98 v=-12,-40
p=71,93 v=-12,-87
p=36,86 v=-40,-3
p=10,36 v=-32,-73
p=71,96 v=-34,-89
p=71,1 v=-4,-17
p=31,5 v=8,-78
p=100,2 v=31,13
p=98,44 v=6,-44
p=84,66 v=-13,23
p=32,30 v=20,-67
p=70,53 v=83,-99
p=15,93 v=25,1
p=2,71 v=-71,84
p=13,94 v=-25,47
p=73,34 v=-60,88
p=90,33 v=86,98
p=15,52 v=16,68
p=10,70 v=-87,-91
p=59,50 v=5,95
p=16,77 v=23,20
p=49,24 v=80,-2
p=29,97 v=-84,-64
p=20,48 v=-81,-65
p=78,39 v=50,-62
p=68,67 v=-5,-72
p=81,100 v=-58,-14
p=35,23 v=21,-43
p=85,91 v=92,-37
p=35,97 v=6,-29
p=80,51 v=-16,-98
p=70,76 v=71,44
p=17,53 v=-37,-12
p=8,1 v=-22,78
p=100,74 v=-79,-87
p=43,39 v=-90,-81
p=2,83 v=73,-68
p=96,14 v=84,-4
p=32,18 v=-47,-78
p=66,87 v=-3,-45
p=24,93 v=73,-26
p=83,63 v=87,23
p=44,93 v=-46,1
p=84,46 v=-63,15
p=81,77 v=85,-90
p=83,6 v=87,-6
p=47,44 v=7,-19
p=95,71 v=-9,20
p=91,77 v=-8,-75
p=64,89 v=-4,12
p=95,37 v=-14,-59
p=55,62 v=35,82
p=41,70 v=62,50
p=78,43 v=-8,-20
p=92,57 v=86,84
p=25,82 v=-30,16
p=11,7 v=-78,44
p=19,38 v=51,25
p=17,101 v=-28,-21
p=97,59 v=38,15
p=34,95 v=65,9
p=17,88 v=45,-95
p=80,27 v=-12,-93
p=66,72 v=-52,-91
p=21,64 v=24,-16
p=37,18 v=-86,48
p=53,15 v=-89,-13
p=0,45 v=28,-73
p=47,79 v=-99,99
p=70,95 v=-88,-10
p=72,50 v=-6,80
p=77,58 v=-83,91
p=15,29 v=-57,94
p=7,36 v=61,18
p=3,44 v=-19,-19
p=52,92 v=8,35
p=8,77 v=-22,12
p=88,33 v=36,83
p=32,45 v=-42,-85
p=52,98 v=-44,-10
p=1,51 v=-63,26
p=7,64 v=-61,79
p=35,11 v=66,-59
p=80,92 v=92,97
p=77,49 v=-53,-15
p=80,100 v=-10,78
p=47,33 v=58,43
p=37,91 v=-92,24
p=75,1 v=47,97
p=7,59 v=93,8
p=98,72 v=-67,50
p=76,1 v=-59,63
p=94,88 v=37,-79
p=54,82 v=-54,-87
p=43,1 v=-92,-86
p=54,63 v=-54,69
p=13,80 v=-76,-60
p=56,42 v=-46,3
p=48,52 v=-95,-95
p=93,67 v=-68,69
p=37,65 v=64,-61
p=95,79 v=32,-91
p=96,95 v=-68,-14
p=23,89 v=-79,-79
p=43,63 v=-88,-19
p=40,62 v=56,98
p=52,26 v=6,-70
p=26,12 v=-63,2
p=89,61 v=88,42
p=81,55 v=91,38
p=72,92 v=-63,-2
p=64,77 v=-51,-45
p=38,68 v=-71,25
p=58,32 v=-33,-53
p=55,60 v=97,-80
p=49,102 v=-11,-26
p=95,4 v=36,82
p=83,33 v=67,-70
p=90,59 v=-57,-80
p=12,16 v=-28,36
p=50,24 v=-92,-28
p=13,72 v=76,-84
p=91,98 v=-80,-69
p=88,10 v=55,-24
p=97,67 v=-19,92
p=72,93 v=-7,5
p=85,41 v=-64,83
p=5,5 v=-42,87
p=3,46 v=-22,72
p=33,37 v=-30,77
p=83,27 v=8,46
p=11,2 v=-75,-82
p=41,7 v=-87,78
p=51,30 v=58,-47
p=24,15 v=-33,-97
p=92,50 v=-69,35
p=74,38 v=-64,-70
p=12,62 v=-76,-65
p=11,74 v=-80,5
p=96,65 v=-70,69
p=1,32 v=-71,-77
p=82,39 v=33,26
p=28,46 v=80,-98
p=51,85 v=-2,5
p=69,52 v=-52,76
p=22,68 v=-23,-22
p=56,13 v=61,71
p=79,78 v=-95,-50
p=4,90 v=-71,-14
p=76,31 v=-50,94
p=69,72 v=95,78
p=5,96 v=-70,-85
p=17,87 v=28,-67
p=10,3 v=95,-27
p=44,94 v=-40,-29
p=29,49 v=18,53
p=4,97 v=-19,-29
p=1,98 v=32,47
p=25,34 v=11,72
p=39,81 v=-89,1
p=37,42 v=-39,45
p=64,4 v=-8,52
p=7,8 v=-37,-37
p=58,94 v=54,-82
p=63,27 v=39,74
p=8,30 v=25,75
p=60,90 v=-51,70
p=94,90 v=-23,-9
p=91,45 v=-14,38
p=63,42 v=-51,30
p=66,83 v=28,4
p=58,79 v=5,-72
p=34,99 v=-42,10
p=51,69 v=-47,69
p=38,77 v=64,-45
p=18,59 v=20,-38
p=79,31 v=43,-62
p=29,0 v=-84,63
p=72,12 v=38,71
p=61,56 v=-50,88
p=32,37 v=-51,-23
p=42,43 v=-24,61
p=51,41 v=-95,92
p=39,12 v=12,73
p=83,21 v=-72,1
p=12,79 v=-77,12
p=15,60 v=67,30
p=62,92 v=-47,62
p=42,95 v=53,-64
p=100,45 v=-68,-92
p=50,73 v=-95,-95
p=30,88 v=16,-79
p=64,51 v=45,64
p=98,72 v=-64,46
p=65,34 v=-3,76
p=26,88 v=65,78
p=5,60 v=36,42
p=3,33 v=-39,84
p=41,90 v=-64,2
p=90,52 v=-65,-65
p=39,63 v=16,-45
p=85,19 v=37,98
p=64,29 v=-5,-31
p=82,9 v=-21,2
p=34,93 v=-39,-60
p=86,1 v=91,40
p=49,57 v=-50,25
p=26,82 v=67,-25
p=10,23 v=-81,21
p=7,7 v=25,82
p=87,24 v=-83,92