Lukas Angerer 2 роки тому
батько
коміт
c63aaa97f1
6 змінених файлів з 1541 додано та 1 видалено
  1. 43 0
      Day22/Brick.cs
  2. 177 0
      Day22/BrickStack.cs
  3. 8 1
      Day22/Parser.cs
  4. 11 0
      Day22/Program.cs
  5. 44 0
      Day22/Vec.cs
  6. 1258 0
      Day22/inputs/input-lar.txt

+ 43 - 0
Day22/Brick.cs

@@ -0,0 +1,43 @@
+namespace Day22;
+
+public class Brick
+{
+    private static int _count = 0;
+    
+    public Vec Start { get; private set; }
+    public Vec End { get; private set; }
+    public Vec Axis { get; }
+    public long Size { get; }
+    public char Label { get; }
+    public long MinZ { get; private set; }
+    
+    public Brick(Vec start, Vec end)
+    {
+        Start = start;
+        End = end;
+        Label = (char)('A' + _count % 26);
+        _count++;
+
+        Axis = End.Subtract(Start);
+        Size = Axis.Magnitude();
+        MinZ = Math.Min(Start.Z, End.Z);
+    }
+
+    public IEnumerable<Vec> Points()
+    {
+        var p = Start;
+        var v = Axis.Normalize();
+        for (var i = 0; i <= Size; i++)
+        {
+            yield return p;
+            p = p.Add(v);
+        }
+    }
+
+    public void MoveDown(long count)
+    {
+        Start = Start.Add(Vec.Down.Multiply(count));
+        End = End.Add(Vec.Down.Multiply(count));
+        MinZ = Math.Min(Start.Z, End.Z);
+    }
+}

+ 177 - 0
Day22/BrickStack.cs

@@ -0,0 +1,177 @@
+namespace Day22;
+
+public class BrickStack
+{
+    private readonly List<Brick> _bricks = new List<Brick>();
+    private Dictionary<Vec, Brick?> _space = new Dictionary<Vec, Brick?>();
+    private Vec _min = Vec.Zero;
+    private Vec _max = Vec.Zero;
+    
+    public BrickStack()
+    {
+        
+    }
+
+    public void Add(Brick brick)
+    {
+        _bricks.Add(brick);
+
+        _min = Min(_min, brick.Start, brick.End);
+        _max = Max(_max, brick.Start, brick.End);
+    }
+
+    public void Populate()
+    {
+        _space = new Dictionary<Vec, Brick?>();
+        foreach (var b in _bricks.OrderBy(x => x.MinZ))
+        {
+            foreach (var p in b.Points())
+            {
+                if (!_space.TryAdd(p, b))
+                {
+                    throw new Exception("Unexpected overlap during populate phase");
+                }
+            }
+        }
+    }
+
+    public void Collapse()
+    {
+        foreach (var b in _bricks.OrderBy(x => x.MinZ))
+        {
+            var newZ = 1L;
+            foreach (var p in b.Points())
+            {
+                var below = p;
+                while (below.Z > newZ - 1)
+                {
+                    var target = _space.GetValueOrDefault(below);
+                    if (target == null || target == b)
+                    {
+                        below = below.Add(Vec.Down);
+                    }
+                    else
+                    {
+                        if (below.Z + 1 > newZ)
+                        {
+                            newZ = below.Z + 1;
+                        }
+
+                        break;
+                    }
+                }
+            }
+
+            if (newZ < b.MinZ)
+            {
+                MoveDown(b, b.MinZ - newZ);
+            }
+        }
+    }
+
+    public void Print()
+    {
+        for (var y = _min.Y; y <= _max.Y; y++)
+        {
+            for (var z = _min.Z; z <= Math.Min(_max.Z, 19); z++)
+            {
+                for (var x = _min.X; x <= _max.X; x++)
+                {
+                    var brick = _space.GetValueOrDefault(new Vec(x, y, z));
+                    if (brick != null)
+                    {
+                        Console.Write(brick.Label);
+                    }
+                    else
+                    {
+                        Console.Write('.');
+                    }
+                }
+
+                Console.Write(' ');
+            }
+            
+            Console.WriteLine();
+        }
+    }
+
+    public long CountSafeRemoval()
+    {
+        var count = 0L;
+        foreach (var b in _bricks.OrderBy(x => x.MinZ))
+        {
+            var above = BricksAbove(b).ToList();
+            
+            if (above.Count == 0 || above.All(a => BricksBelow(a).Count() >= 2))
+            {
+                count++;
+            }
+        }
+
+        return count;
+    }
+
+    private Vec Min(params Vec[] vectors)
+    {
+        var x = vectors[0].X;
+        var y = vectors[0].Y;
+        var z = vectors[0].Z;
+        foreach (var v in vectors.Skip(1))
+        {
+            x = Math.Min(x, v.X);
+            y = Math.Min(y, v.Y);
+            z = Math.Min(z, v.Z);
+        }
+
+        return new Vec(x, y, z);
+    }
+    
+    private Vec Max(params Vec[] vectors)
+    {
+        var x = vectors[0].X;
+        var y = vectors[0].Y;
+        var z = vectors[0].Z;
+        foreach (var v in vectors.Skip(1))
+        {
+            x = Math.Max(x, v.X);
+            y = Math.Max(y, v.Y);
+            z = Math.Max(z, v.Z);
+        }
+
+        return new Vec(x, y, z);
+    }
+
+    private void MoveDown(Brick brick, long count)
+    {
+        foreach (var p in brick.Points())
+        {
+            _space.Remove(p);
+        }
+        brick.MoveDown(count);
+        foreach (var p in brick.Points())
+        {
+            if (!_space.TryAdd(p, brick))
+            {
+                throw new Exception("Unexpected overlap during collapse phase");
+            }
+        }
+    }
+
+    private IEnumerable<Brick> BricksAbove(Brick brick)
+    {
+        return brick.Points()
+            .Select(p => _space.GetValueOrDefault(p.Add(Vec.Up)))
+            .Where(b => b != null && b != brick)
+            .Cast<Brick>()
+            .Distinct();
+    }
+    
+    private IEnumerable<Brick> BricksBelow(Brick brick)
+    {
+        return brick.Points()
+            .Select(p => _space.GetValueOrDefault(p.Add(Vec.Down)))
+            .Where(b => b != null && b != brick)
+            .Cast<Brick>()
+            .Distinct();
+    }
+}

+ 8 - 1
Day22/Parser.cs

@@ -7,13 +7,20 @@ public partial class Parser
     [GeneratedRegex(@".*")]
     private partial Regex LineMatch();
     
-    public void Parse(string inputFile)
+    public BrickStack Parse(string inputFile)
     {
+        var brickStack = new BrickStack();
         using var reader = File.OpenText(inputFile);
         
         while (!reader.EndOfStream)
         {
             var line = reader.ReadLine()!;
+            var parts = line.Split('~');
+            var points = parts.Take(2).Select(s => Vec.FromArray(s.Split(',').Select(int.Parse).ToArray())).ToArray();
+            
+            brickStack.Add(new Brick(points[0], points[1]));
         }
+
+        return brickStack;
     }
 }

+ 11 - 0
Day22/Program.cs

@@ -16,5 +16,16 @@ if (args.Length < 1)
 
 var inputFile = args[0];
 var parser = new Parser();
+var brickStack = parser.Parse(inputFile);
+
+brickStack.Populate();
+brickStack.Print();
+Console.WriteLine();
+brickStack.Collapse();
+brickStack.Print();
+
+Console.WriteLine();
+var count = brickStack.CountSafeRemoval();
+Console.WriteLine($"Can be disintegrated: {count}");
 
 return 0;

+ 44 - 0
Day22/Vec.cs

@@ -0,0 +1,44 @@
+namespace Day22;
+
+public record struct Vec(long X, long Y, long Z)
+{
+    public static Vec Zero { get; } = new Vec(0, 0, 0);
+    public static Vec Up { get; } = new Vec(0, 0, 1);
+    public static Vec Down { get; } = new Vec(0, 0, -1);
+
+    public static Vec FromArray(int[] nums)
+    {
+        return new Vec(nums[0], nums[1], nums[2]);
+    }
+
+    public Vec Add(Vec other)
+    {
+        return new Vec(X + other.X, Y + other.Y, Z + other.Z);
+    }
+
+    public Vec Subtract(Vec other)
+    {
+        return new Vec(X - other.X, Y - other.Y, Z - other.Z);
+    }
+    
+    public long Magnitude()
+    {
+        if (new[] { X, Y, Z }.Count(v => v == 0) < 2)
+        {
+            throw new Exception("Only works with one-axis vectors");
+        }
+        return X + Y + Z;
+    }
+
+    public Vec Normalize()
+    {
+        var length = Magnitude();
+        length = length == 0 ? 1 : length;
+        return new Vec(X / length, Y / length, Z / length);
+    }
+
+    public Vec Multiply(long f)
+    {
+        return new Vec(f * X, f * Y, f * Z);
+    }
+}

+ 1258 - 0
Day22/inputs/input-lar.txt

@@ -0,0 +1,1258 @@
+4,0,16~4,0,18
+2,8,126~5,8,126
+7,7,68~9,7,68
+1,3,122~1,6,122
+3,3,67~3,6,67
+7,6,226~9,6,226
+1,5,123~1,6,123
+5,3,47~5,3,49
+7,1,148~7,2,148
+5,4,69~5,6,69
+7,8,277~7,9,277
+4,8,49~4,9,49
+0,5,91~0,7,91
+0,9,58~1,9,58
+6,8,37~7,8,37
+2,8,32~2,8,33
+6,1,175~7,1,175
+1,4,195~3,4,195
+2,3,63~2,5,63
+8,5,77~8,7,77
+7,3,80~7,5,80
+4,5,204~6,5,204
+5,3,138~7,3,138
+5,7,11~5,9,11
+8,0,202~8,0,204
+2,1,214~4,1,214
+9,3,236~9,5,236
+4,6,123~4,8,123
+1,8,158~4,8,158
+2,5,170~4,5,170
+5,6,137~5,6,139
+6,0,287~6,0,288
+9,1,241~9,3,241
+0,0,233~0,0,236
+0,6,210~0,8,210
+5,6,227~5,7,227
+0,1,180~0,4,180
+5,8,161~7,8,161
+7,4,106~7,7,106
+8,2,169~8,2,172
+7,2,102~7,2,104
+9,7,118~9,9,118
+5,5,63~5,7,63
+5,8,272~8,8,272
+4,7,70~4,7,73
+2,5,182~3,5,182
+5,9,143~5,9,145
+8,0,5~8,2,5
+9,0,47~9,2,47
+5,4,63~7,4,63
+4,4,152~4,7,152
+4,4,125~4,6,125
+2,2,52~2,6,52
+3,1,227~3,3,227
+9,2,167~9,4,167
+3,1,261~3,4,261
+3,9,112~4,9,112
+3,8,149~5,8,149
+4,0,71~4,2,71
+3,5,202~5,5,202
+5,1,45~6,1,45
+1,9,235~4,9,235
+0,6,87~0,8,87
+6,5,247~9,5,247
+6,7,4~6,8,4
+6,7,125~6,7,127
+7,2,223~7,3,223
+6,5,245~6,6,245
+6,3,9~6,4,9
+9,5,83~9,5,86
+2,5,96~2,7,96
+2,5,93~2,6,93
+1,0,153~4,0,153
+1,2,156~3,2,156
+6,5,187~6,8,187
+2,9,167~5,9,167
+6,6,247~6,8,247
+2,4,68~3,4,68
+1,0,188~4,0,188
+2,3,1~2,3,3
+9,1,92~9,4,92
+7,4,35~9,4,35
+0,2,152~2,2,152
+8,1,78~8,1,79
+2,4,26~2,6,26
+3,1,280~3,2,280
+5,6,51~6,6,51
+3,9,40~6,9,40
+6,3,64~6,5,64
+6,6,150~8,6,150
+0,6,242~1,6,242
+2,2,88~4,2,88
+5,4,100~5,7,100
+1,6,5~4,6,5
+5,0,137~5,2,137
+7,2,193~7,2,193
+6,6,220~6,7,220
+2,7,20~2,7,22
+2,0,24~3,0,24
+0,7,49~0,9,49
+4,6,41~6,6,41
+8,6,110~8,8,110
+0,5,17~2,5,17
+4,5,258~4,8,258
+5,7,165~6,7,165
+1,7,17~2,7,17
+2,8,204~2,8,207
+9,8,22~9,9,22
+9,0,180~9,2,180
+1,9,172~2,9,172
+1,0,219~3,0,219
+1,9,211~2,9,211
+2,0,138~2,1,138
+5,3,185~5,3,188
+5,3,257~7,3,257
+4,0,190~5,0,190
+2,7,39~4,7,39
+3,0,11~3,1,11
+8,6,26~8,6,29
+2,0,227~4,0,227
+9,0,31~9,3,31
+0,1,21~2,1,21
+1,1,222~3,1,222
+1,8,74~3,8,74
+4,1,6~4,2,6
+6,9,22~8,9,22
+2,3,173~5,3,173
+0,7,140~0,9,140
+3,1,191~4,1,191
+4,7,222~6,7,222
+4,7,113~6,7,113
+5,2,217~5,4,217
+5,4,32~5,7,32
+7,8,180~9,8,180
+4,5,243~6,5,243
+4,2,128~4,4,128
+0,9,54~3,9,54
+4,4,274~4,6,274
+5,2,72~5,5,72
+3,8,266~5,8,266
+4,8,136~6,8,136
+1,4,116~3,4,116
+8,0,62~8,2,62
+0,6,127~0,6,128
+0,3,49~3,3,49
+9,3,166~9,6,166
+2,4,197~2,6,197
+4,3,265~6,3,265
+4,4,236~4,7,236
+4,1,59~4,4,59
+8,6,181~8,6,181
+5,4,170~5,5,170
+1,5,22~1,7,22
+7,2,106~8,2,106
+3,6,227~3,8,227
+4,3,292~4,5,292
+3,0,273~3,2,273
+7,3,58~7,6,58
+4,7,242~4,7,243
+5,5,75~5,8,75
+7,6,239~7,7,239
+9,6,112~9,7,112
+6,7,133~7,7,133
+1,2,2~3,2,2
+1,9,293~3,9,293
+7,0,212~7,0,215
+3,5,260~5,5,260
+0,4,220~1,4,220
+5,7,238~7,7,238
+3,4,276~5,4,276
+5,7,134~5,9,134
+1,6,152~2,6,152
+9,6,225~9,7,225
+4,1,50~6,1,50
+2,8,287~3,8,287
+2,6,242~4,6,242
+3,1,276~3,2,276
+9,8,25~9,9,25
+0,2,275~2,2,275
+1,1,92~4,1,92
+3,6,151~5,6,151
+3,0,152~3,3,152
+6,2,28~9,2,28
+2,7,3~2,9,3
+2,1,56~2,3,56
+1,8,29~4,8,29
+3,5,204~3,8,204
+3,1,249~3,4,249
+7,4,231~7,6,231
+7,4,163~7,6,163
+2,9,208~4,9,208
+0,3,124~0,4,124
+5,1,20~8,1,20
+0,5,144~2,5,144
+4,0,201~4,0,203
+4,5,278~7,5,278
+8,0,246~8,2,246
+5,1,127~5,3,127
+4,5,62~4,8,62
+9,7,3~9,7,6
+2,0,230~4,0,230
+2,6,290~2,8,290
+6,6,180~8,6,180
+3,1,48~3,1,50
+4,8,155~7,8,155
+0,5,62~0,5,64
+4,4,226~7,4,226
+2,9,83~5,9,83
+0,0,49~0,1,49
+4,7,154~4,8,154
+0,4,280~2,4,280
+6,8,41~9,8,41
+2,5,200~2,8,200
+7,6,81~9,6,81
+4,1,253~6,1,253
+1,6,226~1,8,226
+4,8,278~5,8,278
+3,5,136~3,7,136
+8,2,164~9,2,164
+1,7,73~2,7,73
+0,9,265~1,9,265
+6,8,250~8,8,250
+6,4,229~6,6,229
+5,1,199~6,1,199
+4,7,130~7,7,130
+2,2,172~2,5,172
+5,5,80~5,7,80
+3,7,255~3,9,255
+2,2,131~3,2,131
+2,1,67~4,1,67
+8,1,134~8,3,134
+4,0,13~6,0,13
+4,0,170~7,0,170
+0,0,127~0,3,127
+0,4,34~1,4,34
+0,6,38~0,8,38
+4,0,175~4,2,175
+1,9,169~4,9,169
+4,2,280~4,2,283
+0,4,149~2,4,149
+7,3,111~7,6,111
+0,3,282~0,4,282
+0,5,4~3,5,4
+4,8,204~4,9,204
+3,5,186~3,8,186
+0,4,270~0,7,270
+7,0,258~9,0,258
+9,5,205~9,8,205
+7,4,229~7,6,229
+5,3,145~5,6,145
+6,6,63~8,6,63
+4,0,29~4,1,29
+4,7,104~4,9,104
+2,8,35~2,9,35
+3,5,270~3,5,271
+7,6,72~8,6,72
+6,0,51~6,2,51
+9,7,23~9,9,23
+2,1,39~5,1,39
+5,3,130~7,3,130
+5,3,63~6,3,63
+2,1,24~2,1,26
+6,3,77~9,3,77
+3,8,268~5,8,268
+9,1,67~9,4,67
+1,7,26~1,7,29
+4,5,72~4,6,72
+4,2,1~4,2,2
+3,7,34~3,9,34
+5,5,283~5,7,283
+0,2,58~0,3,58
+2,2,274~4,2,274
+6,1,92~8,1,92
+1,5,129~1,8,129
+3,1,10~4,1,10
+2,3,292~2,6,292
+4,3,38~6,3,38
+5,3,87~5,3,87
+7,0,61~9,0,61
+6,0,221~6,2,221
+8,7,207~8,9,207
+8,3,1~8,5,1
+7,6,240~8,6,240
+7,2,258~7,4,258
+0,1,40~0,4,40
+2,8,263~2,9,263
+2,2,74~4,2,74
+6,5,76~8,5,76
+5,1,42~8,1,42
+6,6,278~6,8,278
+6,5,156~6,7,156
+2,4,178~4,4,178
+2,0,216~3,0,216
+1,5,90~1,8,90
+2,4,109~4,4,109
+7,4,166~7,5,166
+8,0,247~8,1,247
+0,5,18~0,8,18
+4,3,212~4,5,212
+1,4,142~2,4,142
+5,0,52~5,3,52
+4,8,44~4,9,44
+4,1,24~7,1,24
+2,5,12~4,5,12
+5,0,65~5,2,65
+7,6,148~7,7,148
+8,4,218~8,5,218
+3,6,184~3,8,184
+1,4,289~1,4,291
+0,0,1~0,2,1
+8,6,24~8,8,24
+9,5,33~9,5,35
+9,6,54~9,8,54
+2,7,7~2,8,7
+7,0,19~8,0,19
+5,2,148~5,5,148
+4,0,31~7,0,31
+7,1,75~9,1,75
+6,4,66~9,4,66
+2,3,166~4,3,166
+1,2,128~3,2,128
+0,3,248~2,3,248
+7,2,261~7,4,261
+2,7,69~4,7,69
+6,6,38~6,7,38
+9,4,234~9,6,234
+3,4,181~5,4,181
+5,3,98~8,3,98
+7,3,4~7,5,4
+4,8,56~7,8,56
+3,5,90~3,5,93
+5,9,205~8,9,205
+0,1,235~2,1,235
+3,8,234~5,8,234
+7,8,69~9,8,69
+3,3,62~3,4,62
+2,9,238~2,9,240
+6,1,34~8,1,34
+6,3,218~6,6,218
+0,0,62~0,1,62
+7,5,151~7,7,151
+9,1,10~9,2,10
+5,0,10~5,1,10
+5,6,206~8,6,206
+3,5,169~5,5,169
+3,9,157~6,9,157
+9,7,228~9,9,228
+4,1,54~4,3,54
+5,0,53~5,2,53
+7,3,19~7,3,21
+5,7,78~5,9,78
+4,7,188~6,7,188
+0,5,238~0,7,238
+3,2,92~6,2,92
+8,5,35~8,7,35
+6,7,183~8,7,183
+3,5,95~3,6,95
+1,0,134~3,0,134
+4,7,101~6,7,101
+4,8,14~4,9,14
+5,3,182~5,5,182
+7,4,37~8,4,37
+1,2,39~4,2,39
+4,3,180~5,3,180
+5,9,200~7,9,200
+4,7,42~5,7,42
+2,6,87~2,8,87
+3,5,45~5,5,45
+1,8,264~1,8,266
+3,0,232~3,0,234
+7,6,259~9,6,259
+1,6,191~1,8,191
+0,8,47~1,8,47
+3,1,185~3,4,185
+3,4,147~3,7,147
+6,4,157~6,5,157
+4,2,243~4,4,243
+5,7,16~5,9,16
+7,3,142~7,5,142
+7,6,175~7,8,175
+0,2,130~1,2,130
+6,8,203~9,8,203
+8,3,180~8,5,180
+4,7,61~7,7,61
+7,0,210~7,2,210
+0,0,19~0,4,19
+1,1,81~3,1,81
+9,5,70~9,7,70
+3,2,117~6,2,117
+4,5,178~6,5,178
+6,3,54~6,6,54
+1,5,150~1,6,150
+3,2,18~5,2,18
+6,7,104~6,8,104
+0,7,44~0,9,44
+2,4,157~2,7,157
+0,0,254~0,2,254
+1,4,215~3,4,215
+6,5,124~6,8,124
+0,2,42~0,2,44
+3,2,98~3,3,98
+0,7,137~3,7,137
+4,4,66~5,4,66
+2,1,185~2,3,185
+1,6,130~1,6,133
+7,4,56~7,5,56
+6,8,253~7,8,253
+3,7,229~3,7,231
+9,3,257~9,5,257
+9,6,194~9,9,194
+5,7,235~5,9,235
+1,8,49~2,8,49
+5,1,196~8,1,196
+3,2,244~5,2,244
+0,6,237~0,8,237
+6,4,104~8,4,104
+0,2,47~0,4,47
+7,5,8~7,8,8
+4,4,133~4,5,133
+5,6,112~5,8,112
+8,3,241~8,4,241
+6,6,46~7,6,46
+3,4,113~5,4,113
+7,6,44~7,8,44
+1,6,177~1,8,177
+7,4,264~8,4,264
+0,2,155~2,2,155
+7,7,234~9,7,234
+6,8,43~6,9,43
+1,0,21~4,0,21
+0,7,232~2,7,232
+7,5,164~8,5,164
+4,0,51~4,2,51
+5,6,262~5,7,262
+6,0,290~6,2,290
+1,0,180~1,3,180
+8,8,2~8,8,4
+0,3,57~0,5,57
+6,0,240~6,2,240
+7,0,102~9,0,102
+6,0,16~8,0,16
+1,4,196~1,5,196
+2,2,165~6,2,165
+8,5,163~9,5,163
+2,3,175~2,6,175
+3,5,114~3,7,114
+7,3,171~7,3,171
+2,4,272~2,7,272
+5,1,166~5,3,166
+7,2,207~9,2,207
+0,0,231~2,0,231
+0,7,180~0,9,180
+6,3,132~9,3,132
+4,5,64~4,6,64
+6,9,115~8,9,115
+4,4,112~5,4,112
+6,0,72~7,0,72
+6,8,92~9,8,92
+4,3,293~4,3,295
+4,2,42~4,5,42
+4,9,158~5,9,158
+1,6,237~1,8,237
+3,6,244~3,8,244
+5,3,2~5,4,2
+6,2,243~6,2,245
+5,0,81~7,0,81
+1,4,269~3,4,269
+3,4,74~6,4,74
+3,0,32~3,2,32
+0,8,203~4,8,203
+7,1,72~7,2,72
+1,2,87~1,3,87
+6,6,79~6,9,79
+6,5,5~8,5,5
+2,9,156~4,9,156
+5,7,144~8,7,144
+3,6,7~3,9,7
+7,0,101~7,3,101
+5,9,148~7,9,148
+5,6,71~8,6,71
+4,0,286~7,0,286
+4,5,264~6,5,264
+2,9,205~4,9,205
+6,6,5~9,6,5
+4,1,146~7,1,146
+4,5,58~4,6,58
+7,0,34~9,0,34
+0,7,40~0,7,42
+6,2,175~7,2,175
+4,4,129~4,6,129
+6,0,237~6,2,237
+0,1,52~0,1,53
+0,4,11~2,4,11
+0,5,5~1,5,5
+4,6,233~4,9,233
+7,4,165~7,4,165
+4,3,177~7,3,177
+5,8,132~6,8,132
+3,0,218~5,0,218
+5,7,79~5,8,79
+2,2,151~5,2,151
+1,4,1~3,4,1
+0,4,94~3,4,94
+3,8,189~3,8,191
+1,1,13~3,1,13
+1,9,105~4,9,105
+3,0,198~6,0,198
+9,2,195~9,3,195
+1,6,58~3,6,58
+1,7,87~1,9,87
+9,3,28~9,5,28
+3,4,58~5,4,58
+8,3,16~8,5,16
+3,2,87~5,2,87
+7,1,46~9,1,46
+4,3,104~4,5,104
+5,6,65~5,7,65
+1,4,232~5,4,232
+5,6,102~5,8,102
+2,1,277~3,1,277
+6,3,224~7,3,224
+1,2,14~1,4,14
+6,3,13~6,4,13
+8,4,9~8,6,9
+2,2,221~3,2,221
+4,3,69~4,6,69
+4,4,120~4,6,120
+2,2,140~4,2,140
+8,0,267~8,2,267
+3,4,153~6,4,153
+5,4,253~7,4,253
+4,7,189~4,7,190
+4,8,15~5,8,15
+0,3,141~0,7,141
+6,2,108~6,4,108
+7,8,276~9,8,276
+5,2,1~5,3,1
+1,8,139~4,8,139
+4,4,185~4,5,185
+9,7,119~9,9,119
+7,7,18~7,7,21
+7,1,165~7,3,165
+1,2,78~4,2,78
+5,0,257~7,0,257
+4,9,81~5,9,81
+5,9,153~7,9,153
+2,0,73~4,0,73
+8,0,244~8,3,244
+3,0,79~3,2,79
+6,0,283~6,3,283
+8,5,51~8,8,51
+4,0,60~4,3,60
+6,1,168~8,1,168
+0,5,201~2,5,201
+9,0,182~9,0,184
+4,5,27~4,6,27
+2,4,278~4,4,278
+4,2,218~6,2,218
+2,2,236~5,2,236
+3,6,263~5,6,263
+7,1,73~8,1,73
+1,3,233~1,6,233
+0,4,161~2,4,161
+2,5,222~2,5,224
+6,3,11~6,6,11
+2,7,36~5,7,36
+0,9,1~0,9,3
+4,4,214~4,5,214
+2,5,279~5,5,279
+1,5,19~1,8,19
+2,6,207~4,6,207
+8,1,225~8,4,225
+3,5,87~3,7,87
+7,5,116~9,5,116
+4,8,47~6,8,47
+4,8,40~6,8,40
+8,3,34~8,5,34
+5,2,99~5,3,99
+2,8,157~4,8,157
+9,3,238~9,6,238
+3,3,290~3,5,290
+3,1,1~6,1,1
+3,9,55~3,9,57
+8,4,238~8,6,238
+8,6,21~8,6,23
+5,6,159~7,6,159
+3,2,222~3,2,223
+5,6,77~7,6,77
+2,3,90~2,6,90
+8,5,147~8,7,147
+4,8,105~7,8,105
+1,9,108~2,9,108
+2,6,255~4,6,255
+3,6,165~3,6,167
+5,5,73~7,5,73
+7,3,236~7,5,236
+4,3,215~4,3,217
+8,6,10~8,7,10
+6,7,17~7,7,17
+3,9,137~7,9,137
+3,3,64~3,5,64
+2,2,124~5,2,124
+5,4,244~5,6,244
+4,3,145~4,3,148
+2,5,113~4,5,113
+2,5,2~2,7,2
+2,2,32~2,4,32
+0,1,83~2,1,83
+4,0,177~6,0,177
+2,5,129~2,8,129
+2,4,25~2,6,25
+3,8,10~3,8,12
+4,1,93~4,1,95
+9,3,46~9,6,46
+1,3,181~1,4,181
+6,2,2~6,4,2
+6,5,13~8,5,13
+7,9,157~7,9,159
+4,0,70~4,2,70
+3,6,16~5,6,16
+1,3,208~4,3,208
+4,7,227~4,8,227
+5,6,153~7,6,153
+6,0,17~6,2,17
+4,3,165~4,4,165
+1,8,77~4,8,77
+0,5,206~0,7,206
+0,6,207~1,6,207
+6,7,115~6,7,117
+3,6,72~3,8,72
+7,0,79~9,0,79
+3,4,30~6,4,30
+5,9,156~7,9,156
+0,3,214~1,3,214
+3,7,289~3,9,289
+3,1,187~4,1,187
+3,6,280~6,6,280
+3,4,198~6,4,198
+7,2,138~9,2,138
+4,4,156~4,6,156
+0,4,49~4,4,49
+1,0,236~3,0,236
+2,7,250~2,9,250
+4,7,25~5,7,25
+4,1,216~7,1,216
+0,2,251~0,3,251
+1,0,156~3,0,156
+0,8,95~2,8,95
+5,2,201~5,5,201
+6,8,284~6,8,287
+0,4,281~2,4,281
+4,3,296~7,3,296
+7,5,78~7,7,78
+5,4,180~5,5,180
+1,9,243~3,9,243
+4,1,265~4,2,265
+1,7,188~3,7,188
+3,1,225~5,1,225
+4,4,31~4,4,32
+3,2,3~4,2,3
+4,5,102~5,5,102
+0,5,235~2,5,235
+8,4,168~8,6,168
+8,3,67~8,4,67
+8,5,17~8,7,17
+0,4,37~3,4,37
+5,7,251~5,9,251
+9,6,167~9,7,167
+5,5,2~8,5,2
+3,4,266~3,7,266
+5,1,16~5,4,16
+1,4,243~1,7,243
+5,0,197~5,1,197
+8,3,115~8,4,115
+0,0,60~0,2,60
+9,5,262~9,5,265
+6,5,280~6,5,280
+2,1,55~2,3,55
+6,7,200~9,7,200
+7,2,75~9,2,75
+3,2,97~6,2,97
+3,3,250~3,5,250
+1,3,212~3,3,212
+1,5,221~2,5,221
+2,4,274~2,6,274
+0,5,14~2,5,14
+5,6,36~7,6,36
+1,2,121~3,2,121
+6,4,6~9,4,6
+1,2,81~1,5,81
+7,0,70~7,2,70
+3,5,252~3,7,252
+5,4,254~5,5,254
+5,3,213~5,5,213
+6,3,145~9,3,145
+2,6,227~2,8,227
+6,4,19~9,4,19
+2,3,130~4,3,130
+2,0,82~4,0,82
+0,9,171~3,9,171
+1,7,142~1,8,142
+8,5,196~9,5,196
+4,1,90~7,1,90
+9,1,26~9,5,26
+1,0,137~1,0,137
+9,6,115~9,8,115
+0,9,37~3,9,37
+2,2,220~2,5,220
+4,1,89~4,4,89
+4,4,52~5,4,52
+9,1,179~9,3,179
+6,0,200~8,0,200
+1,1,17~1,3,17
+3,3,43~4,3,43
+5,7,162~5,9,162
+8,2,224~8,5,224
+3,4,106~5,4,106
+1,0,185~1,2,185
+9,5,2~9,7,2
+3,1,8~6,1,8
+5,2,154~6,2,154
+8,0,43~8,1,43
+1,6,85~1,7,85
+6,1,26~7,1,26
+8,2,159~8,5,159
+3,3,51~3,3,53
+1,4,92~3,4,92
+4,5,142~4,6,142
+5,6,273~5,9,273
+1,5,42~3,5,42
+8,1,68~8,4,68
+5,6,105~8,6,105
+1,2,213~1,3,213
+8,1,231~8,2,231
+5,1,285~5,1,287
+8,1,48~8,3,48
+1,4,47~3,4,47
+9,4,111~9,6,111
+2,9,142~4,9,142
+8,3,228~8,3,230
+0,3,215~2,3,215
+6,6,283~6,6,284
+7,3,37~7,3,38
+7,0,159~7,2,159
+4,2,56~4,5,56
+2,0,235~3,0,235
+3,9,141~5,9,141
+2,2,146~5,2,146
+3,4,271~5,4,271
+0,4,130~0,6,130
+7,1,227~9,1,227
+8,1,133~8,3,133
+5,1,142~5,3,142
+7,6,198~7,6,200
+3,9,275~4,9,275
+2,2,134~2,4,134
+6,9,206~6,9,208
+7,1,74~7,3,74
+8,6,201~8,7,201
+7,1,4~9,1,4
+2,3,140~2,6,140
+0,6,176~2,6,176
+8,5,18~8,7,18
+0,4,146~0,6,146
+5,1,279~5,2,279
+2,2,174~4,2,174
+0,6,150~0,8,150
+7,1,169~9,1,169
+9,3,80~9,5,80
+9,4,7~9,5,7
+0,2,54~0,5,54
+0,9,230~3,9,230
+1,4,29~3,4,29
+6,0,54~6,2,54
+7,7,81~7,7,81
+2,8,136~3,8,136
+9,4,31~9,5,31
+9,6,241~9,8,241
+8,2,166~8,4,166
+7,2,8~9,2,8
+5,6,271~5,8,271
+4,0,224~5,0,224
+6,8,200~8,8,200
+0,1,18~3,1,18
+4,2,278~5,2,278
+0,9,258~3,9,258
+1,7,51~1,9,51
+1,2,183~3,2,183
+5,5,30~6,5,30
+2,9,130~4,9,130
+7,5,170~9,5,170
+0,3,61~0,6,61
+6,1,198~8,1,198
+1,3,284~1,5,284
+5,5,245~5,6,245
+5,8,147~5,9,147
+3,1,139~5,1,139
+5,6,108~5,6,110
+9,8,93~9,9,93
+5,1,292~6,1,292
+1,1,157~1,2,157
+5,6,292~5,8,292
+1,0,80~4,0,80
+4,2,45~4,2,47
+5,0,21~7,0,21
+2,6,257~2,8,257
+2,5,70~2,7,70
+0,1,137~0,1,137
+1,2,45~1,5,45
+5,0,256~5,3,256
+4,2,262~4,4,262
+7,3,54~7,5,54
+7,9,23~8,9,23
+2,5,130~2,7,130
+2,8,146~2,9,146
+5,0,15~5,2,15
+4,4,11~4,8,11
+5,4,266~5,6,266
+5,2,95~5,5,95
+0,0,48~0,2,48
+3,5,73~3,7,73
+4,6,8~6,6,8
+3,3,289~5,3,289
+5,7,263~5,9,263
+2,9,251~2,9,251
+3,9,29~5,9,29
+1,2,31~1,4,31
+6,1,230~9,1,230
+6,2,23~9,2,23
+4,5,276~6,5,276
+1,7,194~2,7,194
+1,7,225~4,7,225
+7,6,192~7,7,192
+7,2,140~7,4,140
+6,9,150~8,9,150
+3,3,192~3,5,192
+2,3,213~2,5,213
+0,0,131~0,2,131
+5,1,259~6,1,259
+4,1,12~4,1,14
+0,9,292~3,9,292
+7,4,15~7,6,15
+9,6,43~9,8,43
+4,7,260~4,8,260
+4,1,188~6,1,188
+2,8,89~6,8,89
+7,0,173~7,1,173
+8,5,237~8,8,237
+2,2,10~2,4,10
+4,0,176~4,1,176
+7,3,178~9,3,178
+0,5,133~1,5,133
+5,3,241~5,5,241
+0,4,222~2,4,222
+2,4,296~5,4,296
+8,2,29~8,4,29
+7,5,192~8,5,192
+3,0,85~5,0,85
+4,4,293~6,4,293
+0,3,178~2,3,178
+2,7,4~2,9,4
+7,6,197~7,9,197
+1,9,17~4,9,17
+4,1,276~4,3,276
+4,3,139~7,3,139
+6,6,109~9,6,109
+8,2,196~8,3,196
+0,5,272~0,5,273
+9,7,120~9,8,120
+6,2,173~6,4,173
+6,5,59~8,5,59
+5,0,179~6,0,179
+5,5,10~5,8,10
+0,7,203~2,7,203
+3,1,217~3,2,217
+9,1,262~9,2,262
+3,4,171~6,4,171
+7,4,203~7,6,203
+0,2,4~0,4,4
+6,6,82~6,8,82
+0,3,35~0,6,35
+0,2,6~0,3,6
+6,6,223~9,6,223
+0,1,42~0,1,44
+8,3,163~8,4,163
+3,3,278~4,3,278
+3,5,263~6,5,263
+3,4,151~5,4,151
+3,5,46~4,5,46
+2,4,64~2,4,67
+3,3,85~5,3,85
+2,4,242~5,4,242
+6,2,264~9,2,264
+6,4,206~8,4,206
+1,1,219~3,1,219
+3,3,197~3,4,197
+5,7,2~6,7,2
+5,4,136~5,7,136
+5,0,284~5,2,284
+2,9,245~2,9,248
+1,4,60~3,4,60
+6,7,279~6,9,279
+6,2,41~6,4,41
+7,7,295~8,7,295
+0,0,232~0,3,232
+0,8,260~3,8,260
+4,9,10~5,9,10
+3,0,45~3,2,45
+5,5,34~5,8,34
+3,9,107~3,9,110
+3,0,25~3,2,25
+0,6,126~2,6,126
+3,4,158~5,4,158
+0,7,7~0,9,7
+9,1,243~9,1,245
+1,4,216~1,4,218
+9,3,268~9,5,268
+6,7,111~9,7,111
+2,2,246~5,2,246
+4,0,138~7,0,138
+9,5,248~9,6,248
+5,2,214~5,4,214
+2,1,178~4,1,178
+3,8,192~3,8,195
+8,3,162~8,4,162
+2,7,88~4,7,88
+6,1,142~6,1,144
+3,8,211~3,9,211
+5,4,167~5,5,167
+3,6,259~5,6,259
+4,7,294~7,7,294
+9,2,95~9,3,95
+4,7,176~7,7,176
+4,7,43~5,7,43
+5,9,281~8,9,281
+2,9,9~4,9,9
+6,4,202~6,5,202
+2,7,205~4,7,205
+0,1,222~0,3,222
+5,5,141~5,7,141
+0,6,241~0,9,241
+3,7,129~3,9,129
+2,2,259~5,2,259
+0,6,21~0,8,21
+6,3,18~8,3,18
+6,6,171~8,6,171
+4,5,20~6,5,20
+2,6,40~5,6,40
+3,7,271~3,9,271
+1,3,287~4,3,287
+0,6,88~0,7,88
+0,1,134~2,1,134
+3,9,32~5,9,32
+4,2,267~4,2,269
+7,6,173~7,8,173
+3,7,133~3,9,133
+5,5,185~7,5,185
+4,6,161~7,6,161
+5,7,180~7,7,180
+7,8,177~7,9,177
+4,3,299~4,5,299
+6,2,192~7,2,192
+5,7,286~5,7,288
+9,2,260~9,5,260
+5,4,102~6,4,102
+5,5,225~7,5,225
+0,0,64~1,0,64
+0,5,179~0,7,179
+5,2,73~5,3,73
+2,5,256~2,7,256
+4,5,112~4,7,112
+2,3,40~2,5,40
+7,5,16~7,8,16
+5,1,126~5,2,126
+3,7,286~3,9,286
+0,3,38~2,3,38
+9,2,94~9,3,94
+8,6,172~8,7,172
+2,2,252~3,2,252
+7,4,126~7,5,126
+6,8,139~8,8,139
+8,2,161~9,2,161
+0,2,221~1,2,221
+3,9,164~5,9,164
+3,6,284~3,9,284
+2,1,117~4,1,117
+9,7,160~9,8,160
+9,1,22~9,4,22
+2,8,73~3,8,73
+8,2,206~8,3,206
+6,1,47~8,1,47
+4,1,282~6,1,282
+3,1,189~3,3,189
+1,3,33~1,3,35
+3,0,4~5,0,4
+4,1,115~4,4,115
+2,2,203~5,2,203
+0,4,51~1,4,51
+2,6,55~5,6,55
+3,5,195~4,5,195
+4,2,184~4,4,184
+1,7,52~2,7,52
+5,2,235~7,2,235
+2,2,7~5,2,7
+4,2,24~4,4,24
+9,4,72~9,6,72
+1,0,24~1,0,25
+4,9,154~6,9,154
+4,1,37~4,3,37
+5,9,163~6,9,163
+1,2,290~3,2,290
+3,0,222~5,0,222
+9,7,207~9,9,207
+1,5,230~1,7,230
+0,3,184~2,3,184
+4,1,150~6,1,150
+5,3,291~5,6,291
+3,9,256~6,9,256
+9,3,89~9,5,89
+1,8,160~2,8,160
+3,6,164~5,6,164
+4,9,41~7,9,41
+8,3,80~8,3,83
+6,4,126~6,5,126
+2,4,230~3,4,230
+7,0,167~7,2,167
+6,6,178~6,7,178
+7,5,79~9,5,79
+5,6,226~5,6,226
+9,2,210~9,4,210
+6,1,5~7,1,5
+3,7,228~3,9,228
+8,0,60~8,3,60
+3,6,42~3,9,42
+8,7,153~8,9,153
+2,1,16~2,3,16
+0,7,235~0,7,236
+5,4,53~7,4,53
+5,3,195~6,3,195
+4,1,143~4,3,143
+7,8,53~9,8,53
+4,9,159~4,9,160
+7,1,1~7,4,1
+6,8,281~8,8,281
+3,2,100~3,4,100
+0,3,121~2,3,121
+4,7,161~4,8,161
+4,8,205~4,8,207
+1,7,262~1,9,262
+7,3,192~9,3,192
+3,7,274~3,9,274
+5,4,98~5,6,98
+6,9,230~9,9,230
+4,8,275~7,8,275
+2,8,281~5,8,281
+3,7,131~4,7,131
+8,8,210~8,8,212
+5,3,221~8,3,221
+6,0,80~9,0,80
+8,5,162~8,6,162
+9,5,71~9,7,71
+3,4,252~5,4,252
+0,6,55~0,9,55
+7,4,254~9,4,254
+5,1,135~5,3,135
+8,4,113~8,6,113
+1,6,148~3,6,148
+8,1,137~8,3,137
+8,0,76~9,0,76
+3,7,146~6,7,146
+3,4,254~3,4,256
+5,3,189~5,5,189
+5,4,223~5,6,223
+7,2,24~7,3,24
+4,2,186~7,2,186
+7,4,279~7,6,279
+3,1,66~6,1,66
+3,4,238~6,4,238
+2,6,15~2,9,15
+6,1,53~6,3,53
+4,5,109~6,5,109
+1,5,179~1,7,179
+1,7,5~2,7,5
+3,4,228~3,6,228
+7,1,11~7,3,11
+6,6,194~7,6,194
+2,3,210~5,3,210
+8,7,174~8,8,174
+2,4,234~2,4,236
+8,1,31~8,3,31
+1,3,200~3,3,200
+0,7,86~3,7,86
+6,3,175~6,5,175
+3,4,161~3,6,161
+5,4,227~5,4,229
+4,4,295~6,4,295
+1,9,13~4,9,13
+5,9,140~7,9,140
+6,5,230~8,5,230
+2,0,273~2,2,273
+2,4,177~4,4,177
+8,6,66~8,8,66
+7,9,180~8,9,180
+6,8,19~9,8,19
+6,4,122~6,7,122
+4,8,209~7,8,209
+1,9,158~2,9,158
+1,2,86~3,2,86
+4,7,27~4,9,27
+5,4,199~7,4,199
+6,9,82~8,9,82
+1,6,236~1,7,236
+3,2,154~3,4,154
+4,3,140~4,5,140
+2,1,211~2,4,211
+3,1,251~6,1,251
+9,5,183~9,8,183
+1,4,83~1,6,83
+6,3,240~6,4,240
+1,5,23~1,7,23
+4,5,230~4,7,230
+1,0,83~2,0,83
+2,0,215~2,1,215
+1,8,17~3,8,17
+1,2,83~2,2,83
+7,8,60~7,8,62
+4,7,153~5,7,153
+4,0,140~7,0,140
+2,4,155~2,6,155
+1,2,61~1,4,61
+3,2,8~3,2,10
+2,3,25~5,3,25
+5,5,113~7,5,113
+4,8,248~6,8,248
+0,6,8~0,8,8
+8,3,203~8,6,203
+4,9,19~7,9,19
+8,7,239~8,7,241
+7,0,64~7,0,67
+7,2,33~9,2,33
+5,6,14~5,8,14
+7,0,109~7,2,109
+7,2,29~7,5,29
+3,0,62~5,0,62
+6,3,147~7,3,147
+6,6,49~8,6,49
+7,2,189~7,5,189
+1,1,246~1,4,246
+1,1,288~1,4,288
+0,2,187~1,2,187
+5,0,74~8,0,74
+7,2,169~7,4,169
+4,5,220~6,5,220
+1,6,8~3,6,8
+4,1,32~4,1,34
+5,8,36~6,8,36
+6,8,57~9,8,57
+3,2,63~3,4,63
+2,0,68~2,3,68
+5,2,96~6,2,96
+2,2,75~5,2,75
+1,2,218~3,2,218
+3,4,17~5,4,17
+8,3,164~8,4,164
+2,4,55~2,5,55
+2,2,126~2,4,126
+0,0,22~1,0,22
+5,3,44~5,5,44
+0,1,181~2,1,181
+0,2,182~0,2,184
+9,5,231~9,7,231
+4,2,98~4,4,98
+2,2,44~5,2,44
+6,1,194~8,1,194
+1,5,227~1,8,227
+4,0,3~7,0,3
+6,2,120~6,4,120
+0,5,211~0,6,211
+5,5,18~7,5,18
+8,3,109~8,5,109
+5,5,215~8,5,215
+2,8,8~2,9,8
+6,4,124~7,4,124
+1,2,119~1,5,119
+5,2,60~5,4,60
+6,1,57~8,1,57
+6,0,84~6,0,86
+5,4,137~7,4,137
+1,0,223~3,0,223
+0,5,147~0,8,147
+2,7,183~5,7,183
+0,4,268~3,4,268
+9,4,47~9,5,47
+3,7,253~3,8,253
+5,9,203~5,9,203
+6,2,157~9,2,157
+4,9,113~6,9,113
+2,8,92~3,8,92
+3,4,164~5,4,164
+3,0,31~3,3,31
+8,0,141~8,2,141
+5,2,129~5,2,132
+1,3,84~3,3,84
+8,5,107~8,7,107
+3,9,161~6,9,161
+9,3,193~9,6,193
+8,3,255~8,5,255
+5,4,105~5,5,105
+2,5,179~2,7,179
+3,3,267~3,6,267
+4,4,131~4,6,131
+2,1,51~2,3,51
+5,6,189~7,6,189
+6,6,225~6,6,228
+8,4,257~8,6,257
+3,3,139~3,6,139
+6,1,141~6,3,141
+7,7,74~9,7,74
+6,3,194~8,3,194
+4,2,162~7,2,162
+5,5,129~5,8,129
+2,6,24~4,6,24
+9,1,265~9,4,265
+4,6,239~4,7,239
+5,3,235~5,6,235
+4,4,68~4,7,68
+1,9,144~3,9,144
+0,1,70~2,1,70
+6,8,158~9,8,158
+7,1,233~7,3,233
+4,4,117~6,4,117
+0,8,4~0,9,4
+3,8,292~4,8,292
+2,2,271~4,2,271
+7,3,69~9,3,69
+7,3,32~7,3,34
+9,2,160~9,4,160
+6,2,106~6,5,106
+5,5,28~5,8,28
+6,1,191~8,1,191
+1,0,133~1,3,133
+6,7,145~8,7,145
+7,0,151~7,2,151
+2,0,137~2,3,137
+3,6,37~6,6,37
+7,6,82~7,8,82
+1,3,126~1,5,126
+6,1,21~7,1,21
+0,1,45~2,1,45
+7,6,19~8,6,19
+4,4,14~5,4,14
+4,4,22~4,7,22
+7,6,60~7,7,60
+2,0,28~4,0,28
+3,1,148~5,1,148
+1,1,159~1,4,159
+3,3,41~5,3,41
+1,3,203~1,3,206