import java.util.stream.Stream

class GameRequirements(val gameId: Int, private val requirements: HashMap<String, Int>) {
    val power: Int
        get() {
            return requirements["red"]!! * requirements["green"]!! * requirements["blue"]!!;
        }

    fun isViable(red: Int, green: Int, blue: Int): Boolean {
        return (requirements["red"]!! <= red
                && requirements["green"]!! <= green
                && requirements["blue"]!! <= blue);
    }

    override fun toString(): String {
        return this.gameId.toString() + " " + this.requirements.toString() + " Power: " + power.toString();
    }

    companion object {
        fun fromLine(line: String): GameRequirements {
            val parts = line.split(": ", "; ");
            val rounds = parts.slice(1..<parts.size);
            val gameId = parts[0].replace("Game ", "").toInt();

            val highestRankMap = hashMapOf<String, Int>();
            highestRankMap["red"] = 0;
            highestRankMap["blue"] = 0;
            highestRankMap["green"] = 0;

            for (set in rounds) {
                val counts = set.split(", ");

                for (item in counts) {
                    val itemParts = item.split(" ");
                    val type = itemParts[1];
                    val count = itemParts[0].toInt();

                    val previous = highestRankMap[type]!!;
                    if (count > previous) {
                        highestRankMap[type] = count;
                    }
                }
            }

            return GameRequirements(gameId, highestRankMap);
        }
    }
}

fun List<String>.toGameRequirementsStream(): Stream<GameRequirements> {
    return this.stream().map{ GameRequirements.fromLine(it) };
}

fun Stream<GameRequirements>.viableGames(red: Int, green: Int, blue: Int): Stream<GameRequirements> {
    return this.filter{ it.isViable(red, green, blue)};
}
fun Stream<GameRequirements>.sumOfIds(): Int {
    return this.mapToInt { it.gameId }.sum();
}

Compiled from "GameRequirements.kt"
public final class GameRequirements$Companion {
  private GameRequirements$Companion();
    Code:
       0: aload_0
       1: invokespecial #8                  // Method java/lang/Object."<init>":()V
       4: return

  public final GameRequirements fromLine(java.lang.String);
    Code:
       0: aload_1
       1: ldc           #15                 // String line
       3: invokestatic  #21                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: checkcast     #23                 // class java/lang/CharSequence
      10: iconst_2
      11: anewarray     #25                 // class java/lang/String
      14: astore_3
      15: aload_3
      16: iconst_0
      17: ldc           #27                 // String :
      19: aastore
      20: aload_3
      21: iconst_1
      22: ldc           #29                 // String ;
      24: aastore
      25: aload_3
      26: iconst_0
      27: iconst_0
      28: bipush        6
      30: aconst_null
      31: invokestatic  #35                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      34: astore_2
      35: aload_2
      36: iconst_1
      37: aload_2
      38: invokeinterface #41,  1           // InterfaceMethod java/util/List.size:()I
      43: invokestatic  #47                 // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;
      46: invokestatic  #53                 // Method kotlin/collections/CollectionsKt.slice:(Ljava/util/List;Lkotlin/ranges/IntRange;)Ljava/util/List;
      49: astore_3
      50: aload_2
      51: iconst_0
      52: invokeinterface #57,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      57: checkcast     #25                 // class java/lang/String
      60: ldc           #59                 // String Game
      62: ldc           #61                 // String
      64: iconst_0
      65: iconst_4
      66: aconst_null
      67: invokestatic  #65                 // Method kotlin/text/StringsKt.replace$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Ljava/lang/String;
      70: invokestatic  #71                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      73: istore        4
      75: new           #73                 // class java/util/HashMap
      78: dup
      79: invokespecial #74                 // Method java/util/HashMap."<init>":()V
      82: astore        5
      84: aload         5
      86: checkcast     #76                 // class java/util/Map
      89: ldc           #78                 // String red
      91: iconst_0
      92: invokestatic  #82                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      95: invokeinterface #86,  3           // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     100: pop
     101: aload         5
     103: checkcast     #76                 // class java/util/Map
     106: ldc           #88                 // String blue
     108: iconst_0
     109: invokestatic  #82                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     112: invokeinterface #86,  3           // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     117: pop
     118: aload         5
     120: checkcast     #76                 // class java/util/Map
     123: ldc           #90                 // String green
     125: iconst_0
     126: invokestatic  #82                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     129: invokeinterface #86,  3           // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     134: pop
     135: aload_3
     136: invokeinterface #94,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
     141: astore        6
     143: aload         6
     145: invokeinterface #100,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     150: ifeq          334
     153: aload         6
     155: invokeinterface #104,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     160: checkcast     #25                 // class java/lang/String
     163: astore        7
     165: aload         7
     167: checkcast     #23                 // class java/lang/CharSequence
     170: iconst_1
     171: anewarray     #25                 // class java/lang/String
     174: astore        9
     176: aload         9
     178: iconst_0
     179: ldc           #106                // String ,
     181: aastore
     182: aload         9
     184: iconst_0
     185: iconst_0
     186: bipush        6
     188: aconst_null
     189: invokestatic  #35                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     192: astore        8
     194: aload         8
     196: invokeinterface #94,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
     201: astore        9
     203: aload         9
     205: invokeinterface #100,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     210: ifeq          143
     213: aload         9
     215: invokeinterface #104,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     220: checkcast     #25                 // class java/lang/String
     223: astore        10
     225: aload         10
     227: checkcast     #23                 // class java/lang/CharSequence
     230: iconst_1
     231: anewarray     #25                 // class java/lang/String
     234: astore        12
     236: aload         12
     238: iconst_0
     239: ldc           #108                // String
     241: aastore
     242: aload         12
     244: iconst_0
     245: iconst_0
     246: bipush        6
     248: aconst_null
     249: invokestatic  #35                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     252: astore        11
     254: aload         11
     256: iconst_1
     257: invokeinterface #57,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     262: checkcast     #25                 // class java/lang/String
     265: astore        12
     267: aload         11
     269: iconst_0
     270: invokeinterface #57,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     275: checkcast     #25                 // class java/lang/String
     278: invokestatic  #71                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     281: istore        13
     283: aload         5
     285: aload         12
     287: invokevirtual #111                // Method java/util/HashMap.get:(Ljava/lang/Object;)Ljava/lang/Object;
     290: dup
     291: invokestatic  #115                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     294: checkcast     #117                // class java/lang/Number
     297: invokevirtual #120                // Method java/lang/Number.intValue:()I
     300: istore        14
     302: iload         13
     304: iload         14
     306: if_icmple     203
     309: iload         13
     311: invokestatic  #82                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     314: astore        15
     316: aload         5
     318: checkcast     #76                 // class java/util/Map
     321: aload         12
     323: aload         15
     325: invokeinterface #86,  3           // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     330: pop
     331: goto          203
     334: new           #122                // class GameRequirements
     337: dup
     338: iload         4
     340: aload         5
     342: invokespecial #125                // Method GameRequirements."<init>":(ILjava/util/HashMap;)V
     345: areturn

  public GameRequirements$Companion(kotlin.jvm.internal.DefaultConstructorMarker);
    Code:
       0: aload_0
       1: invokespecial #142                // Method "<init>":()V
       4: return
}

Compiled from "GameRequirements.kt"
public final class GameRequirements {
  public static final GameRequirements$Companion Companion;

  private final int gameId;

  private final java.util.HashMap<java.lang.String, java.lang.Integer> requirements;

  public GameRequirements(int, java.util.HashMap<java.lang.String, java.lang.Integer>);
    Code:
       0: aload_2
       1: ldc           #10                 // String requirements
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: invokespecial #19                 // Method java/lang/Object."<init>":()V
      10: aload_0
      11: iload_1
      12: putfield      #23                 // Field gameId:I
      15: aload_0
      16: aload_2
      17: putfield      #26                 // Field requirements:Ljava/util/HashMap;
      20: return

  public final int getGameId();
    Code:
       0: aload_0
       1: getfield      #23                 // Field gameId:I
       4: ireturn

  public final int getPower();
    Code:
       0: aload_0
       1: getfield      #26                 // Field requirements:Ljava/util/HashMap;
       4: ldc           #33                 // String red
       6: invokevirtual #39                 // Method java/util/HashMap.get:(Ljava/lang/Object;)Ljava/lang/Object;
       9: dup
      10: invokestatic  #43                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      13: checkcast     #45                 // class java/lang/Number
      16: invokevirtual #48                 // Method java/lang/Number.intValue:()I
      19: aload_0
      20: getfield      #26                 // Field requirements:Ljava/util/HashMap;
      23: ldc           #50                 // String green
      25: invokevirtual #39                 // Method java/util/HashMap.get:(Ljava/lang/Object;)Ljava/lang/Object;
      28: dup
      29: invokestatic  #43                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      32: checkcast     #45                 // class java/lang/Number
      35: invokevirtual #48                 // Method java/lang/Number.intValue:()I
      38: imul
      39: aload_0
      40: getfield      #26                 // Field requirements:Ljava/util/HashMap;
      43: ldc           #52                 // String blue
      45: invokevirtual #39                 // Method java/util/HashMap.get:(Ljava/lang/Object;)Ljava/lang/Object;
      48: dup
      49: invokestatic  #43                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      52: checkcast     #45                 // class java/lang/Number
      55: invokevirtual #48                 // Method java/lang/Number.intValue:()I
      58: imul
      59: ireturn

  public final boolean isViable(int, int, int);
    Code:
       0: aload_0
       1: getfield      #26                 // Field requirements:Ljava/util/HashMap;
       4: ldc           #33                 // String red
       6: invokevirtual #39                 // Method java/util/HashMap.get:(Ljava/lang/Object;)Ljava/lang/Object;
       9: dup
      10: invokestatic  #43                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      13: checkcast     #45                 // class java/lang/Number
      16: invokevirtual #48                 // Method java/lang/Number.intValue:()I
      19: iload_1
      20: if_icmpgt     73
      23: aload_0
      24: getfield      #26                 // Field requirements:Ljava/util/HashMap;
      27: ldc           #50                 // String green
      29: invokevirtual #39                 // Method java/util/HashMap.get:(Ljava/lang/Object;)Ljava/lang/Object;
      32: dup
      33: invokestatic  #43                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      36: checkcast     #45                 // class java/lang/Number
      39: invokevirtual #48                 // Method java/lang/Number.intValue:()I
      42: iload_2
      43: if_icmpgt     73
      46: aload_0
      47: getfield      #26                 // Field requirements:Ljava/util/HashMap;
      50: ldc           #52                 // String blue
      52: invokevirtual #39                 // Method java/util/HashMap.get:(Ljava/lang/Object;)Ljava/lang/Object;
      55: dup
      56: invokestatic  #43                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      59: checkcast     #45                 // class java/lang/Number
      62: invokevirtual #48                 // Method java/lang/Number.intValue:()I
      65: iload_3
      66: if_icmpgt     73
      69: iconst_1
      70: goto          74
      73: iconst_0
      74: ireturn

  public java.lang.String toString();
    Code:
       0: new           #58                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #59                 // Method java/lang/StringBuilder."<init>":()V
       7: aload_0
       8: getfield      #23                 // Field gameId:I
      11: invokevirtual #63                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      14: bipush        32
      16: invokevirtual #66                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      19: aload_0
      20: getfield      #26                 // Field requirements:Ljava/util/HashMap;
      23: invokevirtual #69                 // Method java/lang/StringBuilder.append:(Ljava/lang/Object;)Ljava/lang/StringBuilder;
      26: ldc           #71                 // String  Power:
      28: invokevirtual #74                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      31: aload_0
      32: invokevirtual #76                 // Method getPower:()I
      35: invokevirtual #63                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      38: invokevirtual #78                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      41: areturn

  static {};
    Code:
       0: new           #81                 // class GameRequirements$Companion
       3: dup
       4: aconst_null
       5: invokespecial #84                 // Method GameRequirements$Companion."<init>":(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
       8: putstatic     #88                 // Field Companion:LGameRequirements$Companion;
      11: return
}

Compiled from "GameRequirements.kt"
public final class GameRequirementsKt {
  public static final java.util.stream.Stream<GameRequirements> toGameRequirementsStream(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: ldc           #10                 // String <this>
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: invokeinterface #22,  1           // InterfaceMethod java/util/List.stream:()Ljava/util/stream/Stream;
      12: invokedynamic #41,  0             // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;
      17: invokedynamic #52,  0             // InvokeDynamic #1:apply:(Lkotlin/jvm/functions/Function1;)Ljava/util/function/Function;
      22: invokeinterface #58,  2           // InterfaceMethod java/util/stream/Stream.map:(Ljava/util/function/Function;)Ljava/util/stream/Stream;
      27: dup
      28: ldc           #60                 // String map(...)
      30: invokestatic  #63                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      33: areturn

  public static final java.util.stream.Stream<GameRequirements> viableGames(java.util.stream.Stream<GameRequirements>, int, int, int);
    Code:
       0: aload_0
       1: ldc           #10                 // String <this>
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: iload_1
       8: iload_2
       9: iload_3
      10: invokedynamic #78,  0             // InvokeDynamic #2:invoke:(III)Lkotlin/jvm/functions/Function1;
      15: invokedynamic #89,  0             // InvokeDynamic #3:test:(Lkotlin/jvm/functions/Function1;)Ljava/util/function/Predicate;
      20: invokeinterface #93,  2           // InterfaceMethod java/util/stream/Stream.filter:(Ljava/util/function/Predicate;)Ljava/util/stream/Stream;
      25: dup
      26: ldc           #95                 // String filter(...)
      28: invokestatic  #63                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      31: areturn

  public static final int sumOfIds(java.util.stream.Stream<GameRequirements>);
    Code:
       0: aload_0
       1: ldc           #10                 // String <this>
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: invokedynamic #112,  0            // InvokeDynamic #4:invoke:()Lkotlin/jvm/functions/Function1;
      12: invokedynamic #123,  0            // InvokeDynamic #5:applyAsInt:(Lkotlin/jvm/functions/Function1;)Ljava/util/function/ToIntFunction;
      17: invokeinterface #127,  2          // InterfaceMethod java/util/stream/Stream.mapToInt:(Ljava/util/function/ToIntFunction;)Ljava/util/stream/IntStream;
      22: invokeinterface #133,  1          // InterfaceMethod java/util/stream/IntStream.sum:()I
      27: ireturn

  private static final GameRequirements toGameRequirementsStream$lambda$0(java.lang.String);
    Code:
       0: getstatic     #140                // Field GameRequirements.Companion:LGameRequirements$Companion;
       3: aload_0
       4: invokestatic  #144                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
       7: aload_0
       8: invokevirtual #149                // Method GameRequirements$Companion.fromLine:(Ljava/lang/String;)LGameRequirements;
      11: areturn

  private static final GameRequirements toGameRequirementsStream$lambda$1(kotlin.jvm.functions.Function1, java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: invokeinterface #155,  2          // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;
       7: checkcast     #136                // class GameRequirements
      10: areturn

  private static final boolean viableGames$lambda$2(int, int, int, GameRequirements);
    Code:
       0: aload_3
       1: iload_0
       2: iload_1
       3: iload_2
       4: invokevirtual #163                // Method GameRequirements.isViable:(III)Z
       7: ireturn

  private static final boolean viableGames$lambda$3(kotlin.jvm.functions.Function1, java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: invokeinterface #155,  2          // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;
       7: checkcast     #169                // class java/lang/Boolean
      10: invokevirtual #173                // Method java/lang/Boolean.booleanValue:()Z
      13: ireturn

  private static final int sumOfIds$lambda$4(GameRequirements);
    Code:
       0: aload_0
       1: invokevirtual #176                // Method GameRequirements.getGameId:()I
       4: ireturn

  private static final int sumOfIds$lambda$5(kotlin.jvm.functions.Function1, java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: invokeinterface #155,  2          // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;
       7: checkcast     #178                // class java/lang/Number
      10: invokevirtual #181                // Method java/lang/Number.intValue:()I
      13: ireturn
}


import java.util.*

private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
private fun readLong() = readLn().toLong() // single long
private fun readDouble() = readLn().toDouble() // single double
private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts() = readStrings().map { it.toInt() } // list of ints
private fun readLongs() = readStrings().map { it.toLong() } // list of longs
private fun readDoubles() = readStrings().map { it.toDouble() } // list of doubles

var n : Int = 1024

var visited = BooleanArray(n) { false }
var adj = Array(n) { mutableListOf<Pair<Int,Int>>() }

fun toLeaf(root : Int) : Int {
    if(adj[root].size == 0) return 0
    var max = 0
    for (i in adj[root]){
        max = maxOf(max, 1 + toLeaf(i.first))
    }
    return max
}

fun diameter() : Int{
    var dia = 0
    for (i in 0 until n){
        var max1 = 0
        var max2 = 0
        for (j in adj[0]){
            var t = 1 + toLeaf(j.first)
            if (t > max1){
                max2 = max1
                max1 = t
            }
            dia = maxOf(dia, max1 + max2)
        }
    }
    return dia
}

fun dfs(root : Int){
    if (visited[root]) return
    visited[root] = true
    println(root)
    for(i in adj[root]){
        dfs(i.first)
    }
}

fun dikstra(root : Int) : Array<Int> {
    var distance = Array(n) { Int.MAX_VALUE }
    var processed = BooleanArray(n) { false }
    distance[root] = 0
    val compareByDistance: Comparator<Pair<Int,Int>> = compareBy { it.first }
    var Pq = PriorityQueue<Pair<Int,Int>>(compareByDistance)
    Pq.add(Pair(0,root))
    while (Pq.isNotEmpty()){
        var a = Pq.peek().second
        Pq.remove()
        if(processed[a]) continue
        processed[a] = true
        for( u in adj[a]){
            var b = u.first
            var w = u.second
            if(distance[a] + w < distance[b]){
                distance[b] = distance[a] + w
                Pq.add(Pair(-distance[b],b))
            }
        }
    }
    return distance
}

fun main(){
    n = readInt()
    var q = readInt()

    for (i in 0 until q){
        val (a,b,c) = readInts()
        adj[a - 1].add(Pair(b - 1,c))
        //adj[b - 1].add(Pair(a-1,c))
    }
//    val distance = dikstra(0)
//    for (i in distance)
//        println(i)
    println(diameter())

}

Compiled from "Comparisons.kt"
public final class GraphKt$dikstra$$inlined$compareBy$1<T> implements java.util.Comparator {
  public GraphKt$dikstra$$inlined$compareBy$1();
    Code:
       0: aload_0
       1: invokespecial #16                 // Method java/lang/Object."<init>":()V
       4: return

  public final int compare(T, T);
    Code:
       0: aload_1
       1: checkcast     #23                 // class kotlin/Pair
       4: astore_3
       5: iconst_0
       6: istore        4
       8: aload_3
       9: invokevirtual #27                 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      12: checkcast     #29                 // class java/lang/Comparable
      15: aload_2
      16: checkcast     #23                 // class kotlin/Pair
      19: astore_3
      20: astore        5
      22: iconst_0
      23: istore        4
      25: aload_3
      26: invokevirtual #27                 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      29: checkcast     #29                 // class java/lang/Comparable
      32: aload         5
      34: swap
      35: invokestatic  #35                 // Method kotlin/comparisons/ComparisonsKt.compareValues:(Ljava/lang/Comparable;Ljava/lang/Comparable;)I
      38: ireturn
}

Compiled from "Graph.kt"
public final class GraphKt {
  private static int n;

  private static boolean[] visited;

  private static java.util.List<kotlin.Pair<java.lang.Integer, java.lang.Integer>>[] adj;

  private static final java.lang.String readLn();
    Code:
       0: invokestatic  #11                 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;
       3: dup
       4: invokestatic  #17                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
       7: areturn

  private static final int readInt();
    Code:
       0: invokestatic  #21                 // Method readLn:()Ljava/lang/String;
       3: invokestatic  #27                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
       6: ireturn

  private static final long readLong();
    Code:
       0: invokestatic  #21                 // Method readLn:()Ljava/lang/String;
       3: invokestatic  #35                 // Method java/lang/Long.parseLong:(Ljava/lang/String;)J
       6: lreturn

  private static final double readDouble();
    Code:
       0: invokestatic  #21                 // Method readLn:()Ljava/lang/String;
       3: invokestatic  #43                 // Method java/lang/Double.parseDouble:(Ljava/lang/String;)D
       6: dreturn

  private static final java.util.List<java.lang.String> readStrings();
    Code:
       0: invokestatic  #21                 // Method readLn:()Ljava/lang/String;
       3: checkcast     #48                 // class java/lang/CharSequence
       6: iconst_1
       7: anewarray     #50                 // class java/lang/String
      10: astore_0
      11: aload_0
      12: iconst_0
      13: ldc           #52                 // String
      15: aastore
      16: aload_0
      17: iconst_0
      18: iconst_0
      19: bipush        6
      21: aconst_null
      22: invokestatic  #58                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      25: areturn

  private static final java.util.List<java.lang.Integer> readInts();
    Code:
       0: invokestatic  #62                 // Method readStrings:()Ljava/util/List;
       3: checkcast     #64                 // class java/lang/Iterable
       6: astore_0
       7: iconst_0
       8: istore_1
       9: aload_0
      10: astore_2
      11: new           #66                 // class java/util/ArrayList
      14: dup
      15: aload_0
      16: bipush        10
      18: invokestatic  #72                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      21: invokespecial #76                 // Method java/util/ArrayList."<init>":(I)V
      24: checkcast     #78                 // class java/util/Collection
      27: astore_3
      28: iconst_0
      29: istore        4
      31: aload_2
      32: invokeinterface #82,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      37: astore        5
      39: aload         5
      41: invokeinterface #88,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      46: ifeq          92
      49: aload         5
      51: invokeinterface #92,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      56: astore        6
      58: aload_3
      59: aload         6
      61: checkcast     #50                 // class java/lang/String
      64: astore        7
      66: astore        9
      68: iconst_0
      69: istore        8
      71: aload         7
      73: invokestatic  #27                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      76: nop
      77: invokestatic  #96                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      80: aload         9
      82: swap
      83: invokeinterface #100,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      88: pop
      89: goto          39
      92: aload_3
      93: checkcast     #102                // class java/util/List
      96: nop
      97: areturn

  private static final java.util.List<java.lang.Long> readLongs();
    Code:
       0: invokestatic  #62                 // Method readStrings:()Ljava/util/List;
       3: checkcast     #64                 // class java/lang/Iterable
       6: astore_0
       7: iconst_0
       8: istore_1
       9: aload_0
      10: astore_2
      11: new           #66                 // class java/util/ArrayList
      14: dup
      15: aload_0
      16: bipush        10
      18: invokestatic  #72                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      21: invokespecial #76                 // Method java/util/ArrayList."<init>":(I)V
      24: checkcast     #78                 // class java/util/Collection
      27: astore_3
      28: iconst_0
      29: istore        4
      31: aload_2
      32: invokeinterface #82,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      37: astore        5
      39: aload         5
      41: invokeinterface #88,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      46: ifeq          92
      49: aload         5
      51: invokeinterface #92,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      56: astore        6
      58: aload_3
      59: aload         6
      61: checkcast     #50                 // class java/lang/String
      64: astore        7
      66: astore        9
      68: iconst_0
      69: istore        8
      71: aload         7
      73: invokestatic  #35                 // Method java/lang/Long.parseLong:(Ljava/lang/String;)J
      76: nop
      77: invokestatic  #120                // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
      80: aload         9
      82: swap
      83: invokeinterface #100,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      88: pop
      89: goto          39
      92: aload_3
      93: checkcast     #102                // class java/util/List
      96: nop
      97: areturn

  private static final java.util.List<java.lang.Double> readDoubles();
    Code:
       0: invokestatic  #62                 // Method readStrings:()Ljava/util/List;
       3: checkcast     #64                 // class java/lang/Iterable
       6: astore_0
       7: iconst_0
       8: istore_1
       9: aload_0
      10: astore_2
      11: new           #66                 // class java/util/ArrayList
      14: dup
      15: aload_0
      16: bipush        10
      18: invokestatic  #72                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      21: invokespecial #76                 // Method java/util/ArrayList."<init>":(I)V
      24: checkcast     #78                 // class java/util/Collection
      27: astore_3
      28: iconst_0
      29: istore        4
      31: aload_2
      32: invokeinterface #82,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      37: astore        5
      39: aload         5
      41: invokeinterface #88,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      46: ifeq          92
      49: aload         5
      51: invokeinterface #92,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      56: astore        6
      58: aload_3
      59: aload         6
      61: checkcast     #50                 // class java/lang/String
      64: astore        7
      66: astore        9
      68: iconst_0
      69: istore        8
      71: aload         7
      73: invokestatic  #43                 // Method java/lang/Double.parseDouble:(Ljava/lang/String;)D
      76: nop
      77: invokestatic  #126                // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
      80: aload         9
      82: swap
      83: invokeinterface #100,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      88: pop
      89: goto          39
      92: aload_3
      93: checkcast     #102                // class java/util/List
      96: nop
      97: areturn

  public static final int getN();
    Code:
       0: getstatic     #131                // Field n:I
       3: ireturn

  public static final void setN(int);
    Code:
       0: iload_0
       1: putstatic     #131                // Field n:I
       4: return

  public static final boolean[] getVisited();
    Code:
       0: getstatic     #140                // Field visited:[Z
       3: areturn

  public static final void setVisited(boolean[]);
    Code:
       0: aload_0
       1: ldc           #143                // String <set-?>
       3: invokestatic  #147                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: putstatic     #140                // Field visited:[Z
      10: return

  public static final java.util.List<kotlin.Pair<java.lang.Integer, java.lang.Integer>>[] getAdj();
    Code:
       0: getstatic     #154                // Field adj:[Ljava/util/List;
       3: areturn

  public static final void setAdj(java.util.List<kotlin.Pair<java.lang.Integer, java.lang.Integer>>[]);
    Code:
       0: aload_0
       1: ldc           #143                // String <set-?>
       3: invokestatic  #147                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: putstatic     #154                // Field adj:[Ljava/util/List;
      10: return

  public static final int toLeaf(int);
    Code:
       0: getstatic     #154                // Field adj:[Ljava/util/List;
       3: iload_0
       4: aaload
       5: invokeinterface #162,  1          // InterfaceMethod java/util/List.size:()I
      10: ifne          15
      13: iconst_0
      14: ireturn
      15: iconst_0
      16: istore_1
      17: getstatic     #154                // Field adj:[Ljava/util/List;
      20: iload_0
      21: aaload
      22: invokeinterface #163,  1          // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
      27: astore_2
      28: aload_2
      29: invokeinterface #88,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      34: ifeq          70
      37: aload_2
      38: invokeinterface #92,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      43: checkcast     #165                // class kotlin/Pair
      46: astore_3
      47: iload_1
      48: iconst_1
      49: aload_3
      50: invokevirtual #168                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      53: checkcast     #170                // class java/lang/Number
      56: invokevirtual #173                // Method java/lang/Number.intValue:()I
      59: invokestatic  #175                // Method toLeaf:(I)I
      62: iadd
      63: invokestatic  #181                // Method java/lang/Math.max:(II)I
      66: istore_1
      67: goto          28
      70: iload_1
      71: ireturn

  public static final int diameter();
    Code:
       0: iconst_0
       1: istore_0
       2: iconst_0
       3: istore_1
       4: getstatic     #131                // Field n:I
       7: istore_2
       8: iload_1
       9: iload_2
      10: if_icmpge     100
      13: iconst_0
      14: istore_3
      15: iconst_0
      16: istore        4
      18: getstatic     #154                // Field adj:[Ljava/util/List;
      21: iconst_0
      22: aaload
      23: invokeinterface #163,  1          // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
      28: astore        5
      30: aload         5
      32: invokeinterface #88,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      37: ifeq          94
      40: aload         5
      42: invokeinterface #92,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      47: checkcast     #165                // class kotlin/Pair
      50: astore        6
      52: iconst_1
      53: aload         6
      55: invokevirtual #168                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      58: checkcast     #170                // class java/lang/Number
      61: invokevirtual #173                // Method java/lang/Number.intValue:()I
      64: invokestatic  #175                // Method toLeaf:(I)I
      67: iadd
      68: istore        7
      70: iload         7
      72: iload_3
      73: if_icmple     82
      76: iload_3
      77: istore        4
      79: iload         7
      81: istore_3
      82: iload_0
      83: iload_3
      84: iload         4
      86: iadd
      87: invokestatic  #181                // Method java/lang/Math.max:(II)I
      90: istore_0
      91: goto          30
      94: iinc          1, 1
      97: goto          8
     100: iload_0
     101: ireturn

  public static final void dfs(int);
    Code:
       0: getstatic     #140                // Field visited:[Z
       3: iload_0
       4: baload
       5: ifeq          9
       8: return
       9: getstatic     #140                // Field visited:[Z
      12: iload_0
      13: iconst_1
      14: bastore
      15: getstatic     #197                // Field java/lang/System.out:Ljava/io/PrintStream;
      18: iload_0
      19: invokevirtual #202                // Method java/io/PrintStream.println:(I)V
      22: getstatic     #154                // Field adj:[Ljava/util/List;
      25: iload_0
      26: aaload
      27: invokeinterface #163,  1          // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
      32: astore_1
      33: aload_1
      34: invokeinterface #88,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      39: ifeq          68
      42: aload_1
      43: invokeinterface #92,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      48: checkcast     #165                // class kotlin/Pair
      51: astore_2
      52: aload_2
      53: invokevirtual #168                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
      56: checkcast     #170                // class java/lang/Number
      59: invokevirtual #173                // Method java/lang/Number.intValue:()I
      62: invokestatic  #204                // Method dfs:(I)V
      65: goto          33
      68: return

  public static final java.lang.Integer[] dikstra(int);
    Code:
       0: iconst_0
       1: istore_2
       2: getstatic     #131                // Field n:I
       5: istore_3
       6: iload_3
       7: anewarray     #23                 // class java/lang/Integer
      10: astore        4
      12: iload_2
      13: iload_3
      14: if_icmpge     36
      17: iload_2
      18: istore        5
      20: aload         4
      22: iload         5
      24: ldc           #207                // int 2147483647
      26: invokestatic  #96                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      29: aastore
      30: iinc          2, 1
      33: goto          12
      36: aload         4
      38: astore_1
      39: iconst_0
      40: istore_3
      41: getstatic     #131                // Field n:I
      44: istore        4
      46: iload         4
      48: newarray       boolean
      50: astore        5
      52: iload_3
      53: iload         4
      55: if_icmpge     73
      58: iload_3
      59: istore        6
      61: aload         5
      63: iload         6
      65: iconst_0
      66: bastore
      67: iinc          3, 1
      70: goto          52
      73: aload         5
      75: astore_2
      76: aload_1
      77: iload_0
      78: iconst_0
      79: invokestatic  #96                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      82: aastore
      83: new           #209                // class GraphKt$dikstra$$inlined$compareBy$1
      86: dup
      87: invokespecial #212                // Method GraphKt$dikstra$$inlined$compareBy$1."<init>":()V
      90: checkcast     #214                // class java/util/Comparator
      93: astore_3
      94: new           #216                // class java/util/PriorityQueue
      97: dup
      98: aload_3
      99: invokespecial #219                // Method java/util/PriorityQueue."<init>":(Ljava/util/Comparator;)V
     102: astore        4
     104: aload         4
     106: new           #165                // class kotlin/Pair
     109: dup
     110: iconst_0
     111: invokestatic  #96                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     114: iload_0
     115: invokestatic  #96                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     118: invokespecial #222                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     121: invokevirtual #223                // Method java/util/PriorityQueue.add:(Ljava/lang/Object;)Z
     124: pop
     125: aload         4
     127: checkcast     #78                 // class java/util/Collection
     130: invokeinterface #226,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     135: ifne          142
     138: iconst_1
     139: goto          143
     142: iconst_0
     143: ifeq          313
     146: aload         4
     148: invokevirtual #229                // Method java/util/PriorityQueue.peek:()Ljava/lang/Object;
     151: checkcast     #165                // class kotlin/Pair
     154: invokevirtual #232                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     157: checkcast     #170                // class java/lang/Number
     160: invokevirtual #173                // Method java/lang/Number.intValue:()I
     163: istore        5
     165: aload         4
     167: invokevirtual #235                // Method java/util/PriorityQueue.remove:()Ljava/lang/Object;
     170: pop
     171: aload_2
     172: iload         5
     174: baload
     175: ifne          125
     178: aload_2
     179: iload         5
     181: iconst_1
     182: bastore
     183: getstatic     #154                // Field adj:[Ljava/util/List;
     186: iload         5
     188: aaload
     189: invokeinterface #163,  1          // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
     194: astore        6
     196: aload         6
     198: invokeinterface #88,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     203: ifeq          125
     206: aload         6
     208: invokeinterface #92,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     213: checkcast     #165                // class kotlin/Pair
     216: astore        7
     218: aload         7
     220: invokevirtual #168                // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     223: checkcast     #170                // class java/lang/Number
     226: invokevirtual #173                // Method java/lang/Number.intValue:()I
     229: istore        8
     231: aload         7
     233: invokevirtual #232                // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     236: checkcast     #170                // class java/lang/Number
     239: invokevirtual #173                // Method java/lang/Number.intValue:()I
     242: istore        9
     244: aload_1
     245: iload         5
     247: aaload
     248: invokevirtual #236                // Method java/lang/Integer.intValue:()I
     251: iload         9
     253: iadd
     254: aload_1
     255: iload         8
     257: aaload
     258: invokevirtual #236                // Method java/lang/Integer.intValue:()I
     261: if_icmpge     196
     264: aload_1
     265: iload         8
     267: aload_1
     268: iload         5
     270: aaload
     271: invokevirtual #236                // Method java/lang/Integer.intValue:()I
     274: iload         9
     276: iadd
     277: invokestatic  #96                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     280: aastore
     281: aload         4
     283: new           #165                // class kotlin/Pair
     286: dup
     287: aload_1
     288: iload         8
     290: aaload
     291: invokevirtual #236                // Method java/lang/Integer.intValue:()I
     294: ineg
     295: invokestatic  #96                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     298: iload         8
     300: invokestatic  #96                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     303: invokespecial #222                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     306: invokevirtual #223                // Method java/util/PriorityQueue.add:(Ljava/lang/Object;)Z
     309: pop
     310: goto          196
     313: aload_1
     314: areturn

  public static final void main();
    Code:
       0: invokestatic  #252                // Method readInt:()I
       3: putstatic     #131                // Field n:I
       6: invokestatic  #252                // Method readInt:()I
       9: istore_0
      10: iconst_0
      11: istore_1
      12: iload_0
      13: istore_2
      14: iload_1
      15: iload_2
      16: if_icmpge     107
      19: invokestatic  #254                // Method readInts:()Ljava/util/List;
      22: astore_3
      23: aload_3
      24: iconst_0
      25: invokeinterface #258,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      30: checkcast     #170                // class java/lang/Number
      33: invokevirtual #173                // Method java/lang/Number.intValue:()I
      36: istore        4
      38: aload_3
      39: iconst_1
      40: invokeinterface #258,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      45: checkcast     #170                // class java/lang/Number
      48: invokevirtual #173                // Method java/lang/Number.intValue:()I
      51: istore        5
      53: aload_3
      54: iconst_2
      55: invokeinterface #258,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      60: checkcast     #170                // class java/lang/Number
      63: invokevirtual #173                // Method java/lang/Number.intValue:()I
      66: istore        6
      68: getstatic     #154                // Field adj:[Ljava/util/List;
      71: iload         4
      73: iconst_1
      74: isub
      75: aaload
      76: new           #165                // class kotlin/Pair
      79: dup
      80: iload         5
      82: iconst_1
      83: isub
      84: invokestatic  #96                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      87: iload         6
      89: invokestatic  #96                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      92: invokespecial #222                // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
      95: invokeinterface #259,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     100: pop
     101: iinc          1, 1
     104: goto          14
     107: invokestatic  #261                // Method diameter:()I
     110: istore_1
     111: getstatic     #197                // Field java/lang/System.out:Ljava/io/PrintStream;
     114: iload_1
     115: invokevirtual #202                // Method java/io/PrintStream.println:(I)V
     118: return

  public static void main(java.lang.String[]);
    Code:
       0: invokestatic  #266                // Method main:()V
       3: return

  static {};
    Code:
       0: sipush        1024
       3: putstatic     #131                // Field n:I
       6: iconst_0
       7: istore_0
       8: getstatic     #131                // Field n:I
      11: istore_1
      12: iload_1
      13: newarray       boolean
      15: astore_2
      16: iload_0
      17: iload_1
      18: if_icmpge     33
      21: iload_0
      22: istore_3
      23: aload_2
      24: iload_3
      25: iconst_0
      26: bastore
      27: iinc          0, 1
      30: goto          16
      33: aload_2
      34: putstatic     #140                // Field visited:[Z
      37: iconst_0
      38: istore_0
      39: getstatic     #131                // Field n:I
      42: istore_1
      43: iload_1
      44: anewarray     #102                // class java/util/List
      47: astore_2
      48: iload_0
      49: iload_1
      50: if_icmpge     74
      53: iload_0
      54: istore_3
      55: aload_2
      56: iload_3
      57: new           #66                 // class java/util/ArrayList
      60: dup
      61: invokespecial #270                // Method java/util/ArrayList."<init>":()V
      64: checkcast     #102                // class java/util/List
      67: aastore
      68: iinc          0, 1
      71: goto          48
      74: aload_2
      75: putstatic     #154                // Field adj:[Ljava/util/List;
      78: return
}


import kotlin.math.round;

class Parabola(potCount: Long, xMult: Long, yMult: Long) {
    private val coeffA = xMult + yMult;
    private val coeffB = -2 * yMult * potCount;
    private val coeffC = potCount * potCount * yMult;

    fun minXCoord(): Long {
        val numerator = -1.0 * coeffB;
        val denominator = coeffA * 2.0;
        val result = round(numerator / denominator);
        return result.toLong();
    }

    fun solveAt(xCoord: Double): Long {
        val termA = xCoord * xCoord * coeffA;
        val termB = xCoord * coeffB;
        val termC = coeffC.toDouble();
        val realResult = termA + termB + termC;
        return realResult.toLong();
    }
}

fun solveCase(potCount: Long, xMult: Long, yMult: Long): Long {
    val eq = Parabola(potCount, xMult, yMult);
    val optimal_a_pots: Long = eq.minXCoord();
    val soln: Long = eq.solveAt(optimal_a_pots.toDouble());
    return soln;
}

fun parseTestCase(): Unit {
    val caseParams = readLine()!!.split(" ");
    val potsToBuy = caseParams[0].toLong();
    val xCost = caseParams[1].toLong();
    val yCost = caseParams[2].toLong();
    val result = solveCase(potsToBuy, xCost, yCost);
    println(result);
}

fun main() {
    val caseCount = readLine()!!.toInt();

    for (i in 1..caseCount) {
        parseTestCase();
    }
}

Compiled from "special_shop.kt"
public final class Special_shopKt {
  public static final long solveCase(long, long, long);
    Code:
       0: new           #8                  // class Parabola
       3: dup
       4: lload_0
       5: lload_2
       6: lload         4
       8: invokespecial #12                 // Method Parabola."<init>":(JJJ)V
      11: astore        6
      13: aload         6
      15: invokevirtual #16                 // Method Parabola.minXCoord:()J
      18: lstore        7
      20: aload         6
      22: lload         7
      24: l2d
      25: invokevirtual #20                 // Method Parabola.solveAt:(D)J
      28: lstore        9
      30: lload         9
      32: lreturn

  public static final void parseTestCase();
    Code:
       0: invokestatic  #36                 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;
       3: dup
       4: invokestatic  #42                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
       7: checkcast     #44                 // class java/lang/CharSequence
      10: iconst_1
      11: anewarray     #46                 // class java/lang/String
      14: astore_1
      15: aload_1
      16: iconst_0
      17: ldc           #48                 // String
      19: aastore
      20: aload_1
      21: iconst_0
      22: iconst_0
      23: bipush        6
      25: aconst_null
      26: invokestatic  #54                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      29: astore_0
      30: aload_0
      31: iconst_0
      32: invokeinterface #60,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      37: checkcast     #46                 // class java/lang/String
      40: invokestatic  #66                 // Method java/lang/Long.parseLong:(Ljava/lang/String;)J
      43: lstore_1
      44: aload_0
      45: iconst_1
      46: invokeinterface #60,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      51: checkcast     #46                 // class java/lang/String
      54: invokestatic  #66                 // Method java/lang/Long.parseLong:(Ljava/lang/String;)J
      57: lstore_3
      58: aload_0
      59: iconst_2
      60: invokeinterface #60,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      65: checkcast     #46                 // class java/lang/String
      68: invokestatic  #66                 // Method java/lang/Long.parseLong:(Ljava/lang/String;)J
      71: lstore        5
      73: lload_1
      74: lload_3
      75: lload         5
      77: invokestatic  #68                 // Method solveCase:(JJJ)J
      80: lstore        7
      82: getstatic     #74                 // Field java/lang/System.out:Ljava/io/PrintStream;
      85: lload         7
      87: invokevirtual #80                 // Method java/io/PrintStream.println:(J)V
      90: return

  public static final void main();
    Code:
       0: invokestatic  #36                 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;
       3: dup
       4: invokestatic  #42                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
       7: invokestatic  #93                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      10: istore_0
      11: iconst_1
      12: istore_1
      13: iload_1
      14: iload_0
      15: if_icmpgt     32
      18: invokestatic  #95                 // Method parseTestCase:()V
      21: iload_1
      22: iload_0
      23: if_icmpeq     32
      26: iinc          1, 1
      29: goto          18
      32: return

  public static void main(java.lang.String[]);
    Code:
       0: invokestatic  #101                // Method main:()V
       3: return
}


import java.io.File
import java.math.BigInteger
import java.security.MessageDigest

/**
 * Reads lines from the given input txt file.
 */
fun readInput(name: String) = File("src", "$name.txt").readLines()

/**
 * Converts string to md5 hash.
 */
fun String.md5(): String = BigInteger(1, MessageDigest.getInstance("MD5").digest(toByteArray())).toString(16)

/**
 * From Day 1 solution.
 * Chunks a list by the entry that matches the given predicate.
 */
fun <E> List<E>.chunked(predicate: (E) -> Boolean): List<List<E>> {
    tailrec fun <E> List<E>.accumulatedChunked(acc: List<List<E>>, predicate: (E) -> Boolean): List<List<E>> =
        if (this.isEmpty()) {
            acc
        } else {
            val firstList = this.takeWhile { !predicate(it) }
            val rest = this.dropWhile { !predicate(it) }.dropWhile(predicate)
            rest.accumulatedChunked(acc + listOf(firstList), predicate)
        }

    return this.accumulatedChunked(emptyList(), predicate)
}

/**
 * Creates pairs with all combinations of elements in the two collections.
 */
infix fun <E> Collection<E>.cartesianProduct(r2: Collection<E>): List<Pair<E, E>> {
    return flatMap { x -> r2.map { y -> x to y } }
}

/**
 * Some classes and methods to handle positions and movements in a 2D-space.
 */
data class Position2D(val x: Int, val y: Int) {
    infix operator fun plus(movement: Movement2D) = Position2D(this.x + movement.dx, this.y + movement.dy)

    infix operator fun minus(other: Position2D) = Movement2D(this.x - other.x, this.y - other.y)

    fun isOnOuterEdgeIn(grid: Grid2D<*>) =
        (x == 0) || (x == grid.width - 1) || (y == 0) || (y == grid.height - 1)

    companion object {
        fun from(p: Pair<Int, Int>) = Position2D(p.first, p.second)
    }
}

/**
 * A zero-indexed 2D-space where (0,0) is in the top left corner.
 */
interface Grid2D<out E> {
    val height: Int
    val width: Int

    val allPositions: List<Position2D>

    companion object {

        @JvmName("from1")
        fun from(data: List<CharSequence>): Grid2D<Char> = ListCharSequenceGrid2D(data)

        @JvmName("from2")
        fun <E> from(data: List<List<E>>): Grid2D<E> = ListGrid2D(data)
    }

    operator fun get(position: Position2D): E

}

data class ListGrid2D<out E>(private val data: List<List<E>>) : Grid2D<E> {
    override val height: Int
        get() = data.size
    override val width: Int
        get() = data[0].size

    override val allPositions: List<Position2D>
        get() = ((data[0].indices).toList() cartesianProduct data.indices.toList()).map(Position2D::from)

    override fun get(position: Position2D): E = data[position.y][position.x]
}

data class ListCharSequenceGrid2D(private val data: List<CharSequence>) : Grid2D<Char> {
    override val height: Int
        get() = data.size
    override val width: Int
        get() = data[0].length

    override val allPositions: List<Position2D>
        get() = ((0 until data[0].length).toList() cartesianProduct (data.indices.toList())).map(Position2D::from)

    override fun get(position: Position2D) = data[position.y][position.x]
}

data class Movement2D(val dx: Int, val dy: Int)

Compiled from "Utils.kt"
public final class UtilsKt {
  public static final java.util.List<java.lang.String> readInput(java.lang.String);
    Code:
       0: aload_0
       1: ldc           #10                 // String name
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #18                 // class java/io/File
       9: dup
      10: ldc           #20                 // String src
      12: new           #22                 // class java/lang/StringBuilder
      15: dup
      16: invokespecial #26                 // Method java/lang/StringBuilder."<init>":()V
      19: aload_0
      20: invokevirtual #30                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      23: ldc           #32                 // String .txt
      25: invokevirtual #30                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      28: invokevirtual #36                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      31: invokespecial #39                 // Method java/io/File."<init>":(Ljava/lang/String;Ljava/lang/String;)V
      34: aconst_null
      35: iconst_1
      36: aconst_null
      37: invokestatic  #45                 // Method kotlin/io/FilesKt.readLines$default:(Ljava/io/File;Ljava/nio/charset/Charset;ILjava/lang/Object;)Ljava/util/List;
      40: areturn

  public static final java.lang.String md5(java.lang.String);
    Code:
       0: aload_0
       1: ldc           #50                 // String <this>
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #52                 // class java/math/BigInteger
       9: dup
      10: iconst_1
      11: ldc           #54                 // String MD5
      13: invokestatic  #60                 // Method java/security/MessageDigest.getInstance:(Ljava/lang/String;)Ljava/security/MessageDigest;
      16: aload_0
      17: astore_1
      18: getstatic     #66                 // Field kotlin/text/Charsets.UTF_8:Ljava/nio/charset/Charset;
      21: aload_1
      22: swap
      23: invokevirtual #72                 // Method java/lang/String.getBytes:(Ljava/nio/charset/Charset;)[B
      26: dup
      27: ldc           #74                 // String getBytes(...)
      29: invokestatic  #77                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      32: invokevirtual #81                 // Method java/security/MessageDigest.digest:([B)[B
      35: invokespecial #84                 // Method java/math/BigInteger."<init>":(I[B)V
      38: bipush        16
      40: invokevirtual #87                 // Method java/math/BigInteger.toString:(I)Ljava/lang/String;
      43: dup
      44: ldc           #89                 // String toString(...)
      46: invokestatic  #77                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      49: areturn

  public static final <E> java.util.List<java.util.List<E>> chunked(java.util.List<? extends E>, kotlin.jvm.functions.Function1<? super E, java.lang.Boolean>);
    Code:
       0: aload_0
       1: ldc           #50                 // String <this>
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #95                 // String predicate
       9: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_0
      13: invokestatic  #101                // Method kotlin/collections/CollectionsKt.emptyList:()Ljava/util/List;
      16: aload_1
      17: invokestatic  #105                // Method chunked$accumulatedChunked:(Ljava/util/List;Ljava/util/List;Lkotlin/jvm/functions/Function1;)Ljava/util/List;
      20: areturn

  public static final <E> java.util.List<kotlin.Pair<E, E>> cartesianProduct(java.util.Collection<? extends E>, java.util.Collection<? extends E>);
    Code:
       0: aload_0
       1: ldc           #50                 // String <this>
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: ldc           #113                // String r2
       9: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_0
      13: checkcast     #115                // class java/lang/Iterable
      16: astore_2
      17: iconst_0
      18: istore_3
      19: aload_2
      20: astore        4
      22: new           #117                // class java/util/ArrayList
      25: dup
      26: invokespecial #118                // Method java/util/ArrayList."<init>":()V
      29: checkcast     #120                // class java/util/Collection
      32: astore        5
      34: iconst_0
      35: istore        6
      37: aload         4
      39: invokeinterface #124,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      44: astore        7
      46: aload         7
      48: invokeinterface #130,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      53: ifeq          188
      56: aload         7
      58: invokeinterface #134,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      63: astore        8
      65: aload         8
      67: astore        9
      69: iconst_0
      70: istore        10
      72: aload_1
      73: checkcast     #115                // class java/lang/Iterable
      76: astore        11
      78: iconst_0
      79: istore        12
      81: aload         11
      83: astore        13
      85: new           #117                // class java/util/ArrayList
      88: dup
      89: aload         11
      91: bipush        10
      93: invokestatic  #138                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      96: invokespecial #141                // Method java/util/ArrayList."<init>":(I)V
      99: checkcast     #120                // class java/util/Collection
     102: astore        14
     104: iconst_0
     105: istore        15
     107: aload         13
     109: invokeinterface #124,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     114: astore        16
     116: aload         16
     118: invokeinterface #130,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     123: ifeq          165
     126: aload         16
     128: invokeinterface #134,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     133: astore        17
     135: aload         14
     137: aload         17
     139: astore        18
     141: astore        19
     143: iconst_0
     144: istore        20
     146: aload         9
     148: aload         18
     150: invokestatic  #147                // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     153: aload         19
     155: swap
     156: invokeinterface #151,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     161: pop
     162: goto          116
     165: aload         14
     167: checkcast     #153                // class java/util/List
     170: nop
     171: checkcast     #115                // class java/lang/Iterable
     174: nop
     175: astore        9
     177: aload         5
     179: aload         9
     181: invokestatic  #157                // Method kotlin/collections/CollectionsKt.addAll:(Ljava/util/Collection;Ljava/lang/Iterable;)Z
     184: pop
     185: goto          46
     188: aload         5
     190: checkcast     #153                // class java/util/List
     193: nop
     194: areturn

  private static final <E> java.util.List<java.util.List<E>> chunked$accumulatedChunked(java.util.List<? extends E>, java.util.List<? extends java.util.List<? extends E>>, kotlin.jvm.functions.Function1<? super E, java.lang.Boolean>);
    Code:
       0: aload_0
       1: invokeinterface #182,  1          // InterfaceMethod java/util/List.isEmpty:()Z
       6: ifeq          13
       9: aload_1
      10: goto          361
      13: aload_0
      14: checkcast     #115                // class java/lang/Iterable
      17: astore        4
      19: iconst_0
      20: istore        5
      22: new           #117                // class java/util/ArrayList
      25: dup
      26: invokespecial #118                // Method java/util/ArrayList."<init>":()V
      29: astore        6
      31: aload         4
      33: invokeinterface #124,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      38: astore        7
      40: aload         7
      42: invokeinterface #130,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      47: ifeq          105
      50: aload         7
      52: invokeinterface #134,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      57: astore        8
      59: aload         8
      61: astore        9
      63: iconst_0
      64: istore        10
      66: aload_2
      67: aload         9
      69: invokeinterface #188,  2          // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;
      74: checkcast     #190                // class java/lang/Boolean
      77: invokevirtual #193                // Method java/lang/Boolean.booleanValue:()Z
      80: ifne          87
      83: iconst_1
      84: goto          88
      87: iconst_0
      88: ifne          94
      91: goto          105
      94: aload         6
      96: aload         8
      98: invokevirtual #194                // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     101: pop
     102: goto          40
     105: aload         6
     107: checkcast     #153                // class java/util/List
     110: astore_3
     111: aload_0
     112: checkcast     #115                // class java/lang/Iterable
     115: astore        5
     117: iconst_0
     118: istore        6
     120: iconst_0
     121: istore        7
     123: new           #117                // class java/util/ArrayList
     126: dup
     127: invokespecial #118                // Method java/util/ArrayList."<init>":()V
     130: astore        8
     132: aload         5
     134: invokeinterface #124,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     139: astore        9
     141: aload         9
     143: invokeinterface #130,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     148: ifeq          222
     151: aload         9
     153: invokeinterface #134,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     158: astore        10
     160: iload         7
     162: ifeq          176
     165: aload         8
     167: aload         10
     169: invokevirtual #194                // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     172: pop
     173: goto          141
     176: aload         10
     178: astore        11
     180: iconst_0
     181: istore        12
     183: aload_2
     184: aload         11
     186: invokeinterface #188,  2          // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;
     191: checkcast     #190                // class java/lang/Boolean
     194: invokevirtual #193                // Method java/lang/Boolean.booleanValue:()Z
     197: ifne          204
     200: iconst_1
     201: goto          205
     204: iconst_0
     205: ifne          141
     208: aload         8
     210: aload         10
     212: invokevirtual #194                // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     215: pop
     216: iconst_1
     217: istore        7
     219: goto          141
     222: aload         8
     224: checkcast     #153                // class java/util/List
     227: checkcast     #115                // class java/lang/Iterable
     230: astore        5
     232: nop
     233: iconst_0
     234: istore        6
     236: iconst_0
     237: istore        7
     239: new           #117                // class java/util/ArrayList
     242: dup
     243: invokespecial #118                // Method java/util/ArrayList."<init>":()V
     246: astore        8
     248: aload         5
     250: invokeinterface #124,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     255: astore        9
     257: aload         9
     259: invokeinterface #130,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     264: ifeq          323
     267: aload         9
     269: invokeinterface #134,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     274: astore        10
     276: iload         7
     278: ifeq          292
     281: aload         8
     283: aload         10
     285: invokevirtual #194                // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     288: pop
     289: goto          257
     292: aload_2
     293: aload         10
     295: invokeinterface #188,  2          // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;
     300: checkcast     #190                // class java/lang/Boolean
     303: invokevirtual #193                // Method java/lang/Boolean.booleanValue:()Z
     306: ifne          257
     309: aload         8
     311: aload         10
     313: invokevirtual #194                // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     316: pop
     317: iconst_1
     318: istore        7
     320: goto          257
     323: aload         8
     325: checkcast     #153                // class java/util/List
     328: astore        4
     330: aload_1
     331: checkcast     #120                // class java/util/Collection
     334: aload_3
     335: invokestatic  #198                // Method kotlin/collections/CollectionsKt.listOf:(Ljava/lang/Object;)Ljava/util/List;
     338: checkcast     #115                // class java/lang/Iterable
     341: invokestatic  #202                // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;
     344: astore        5
     346: aload_2
     347: astore        6
     349: aload         4
     351: astore_0
     352: aload         5
     354: astore_1
     355: aload         6
     357: astore_2
     358: goto          0
     361: areturn
}


fun main() {

    val day = "Day04"

    fun assignmentsAsIntRanges(assignments: String) = assignments.split(",")
        .map { it.split("-") }
        .map { (firstSection, lastSection) -> firstSection.toInt()..lastSection.toInt() }

    fun part1(input: List<String>): Int {
        return input.map(::assignmentsAsIntRanges)
            .count { (firstAssignment, secondAssignment) ->
                (firstAssignment - secondAssignment).isEmpty() || (secondAssignment - firstAssignment).isEmpty()
            }
    }

    fun part2(input: List<String>): Int {
        return input.map(::assignmentsAsIntRanges)
            .count { (firstAssignment, secondAssignment) ->
                (firstAssignment intersect secondAssignment).isNotEmpty()
            }
    }

    // test if implementation meets criteria from the description, like:
    val testInput = readInput("${day}_test")
    val input = readInput(day)

    check(part1(testInput) == 2)
    val result1 = part1(input)
    println(result1)
    check(result1 == 518)

    check(part2(testInput) == 4)
    val result2 = part2(input)
    println(result2)
    check(result2 == 909)
}

Compiled from "Day04.kt"
public final class Day04Kt {
  public static final void main();
    Code:
       0: ldc           #8                  // String Day04
       2: astore_0
       3: new           #10                 // class java/lang/StringBuilder
       6: dup
       7: invokespecial #13                 // Method java/lang/StringBuilder."<init>":()V
      10: aload_0
      11: invokevirtual #17                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      14: ldc           #19                 // String _test
      16: invokevirtual #17                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      19: invokevirtual #23                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      22: invokestatic  #29                 // Method UtilsKt.readInput:(Ljava/lang/String;)Ljava/util/List;
      25: astore_1
      26: aload_0
      27: invokestatic  #29                 // Method UtilsKt.readInput:(Ljava/lang/String;)Ljava/util/List;
      30: astore_2
      31: aload_1
      32: invokestatic  #33                 // Method main$part1:(Ljava/util/List;)I
      35: iconst_2
      36: if_icmpne     43
      39: iconst_1
      40: goto          44
      43: iconst_0
      44: ifne          57
      47: new           #35                 // class java/lang/IllegalStateException
      50: dup
      51: ldc           #37                 // String Check failed.
      53: invokespecial #40                 // Method java/lang/IllegalStateException."<init>":(Ljava/lang/String;)V
      56: athrow
      57: aload_2
      58: invokestatic  #33                 // Method main$part1:(Ljava/util/List;)I
      61: istore_3
      62: getstatic     #46                 // Field java/lang/System.out:Ljava/io/PrintStream;
      65: iload_3
      66: invokevirtual #52                 // Method java/io/PrintStream.println:(I)V
      69: iload_3
      70: sipush        518
      73: if_icmpne     80
      76: iconst_1
      77: goto          81
      80: iconst_0
      81: ifne          94
      84: new           #35                 // class java/lang/IllegalStateException
      87: dup
      88: ldc           #37                 // String Check failed.
      90: invokespecial #40                 // Method java/lang/IllegalStateException."<init>":(Ljava/lang/String;)V
      93: athrow
      94: aload_1
      95: invokestatic  #55                 // Method main$part2:(Ljava/util/List;)I
      98: iconst_4
      99: if_icmpne     106
     102: iconst_1
     103: goto          107
     106: iconst_0
     107: ifne          120
     110: new           #35                 // class java/lang/IllegalStateException
     113: dup
     114: ldc           #37                 // String Check failed.
     116: invokespecial #40                 // Method java/lang/IllegalStateException."<init>":(Ljava/lang/String;)V
     119: athrow
     120: aload_2
     121: invokestatic  #55                 // Method main$part2:(Ljava/util/List;)I
     124: istore        4
     126: getstatic     #46                 // Field java/lang/System.out:Ljava/io/PrintStream;
     129: iload         4
     131: invokevirtual #52                 // Method java/io/PrintStream.println:(I)V
     134: iload         4
     136: sipush        909
     139: if_icmpne     146
     142: iconst_1
     143: goto          147
     146: iconst_0
     147: ifne          160
     150: new           #35                 // class java/lang/IllegalStateException
     153: dup
     154: ldc           #37                 // String Check failed.
     156: invokespecial #40                 // Method java/lang/IllegalStateException."<init>":(Ljava/lang/String;)V
     159: athrow
     160: return

  public static void main(java.lang.String[]);
    Code:
       0: invokestatic  #70                 // Method main:()V
       3: return

  private static final java.util.List<kotlin.ranges.IntRange> main$assignmentsAsIntRanges(java.lang.String);
    Code:
       0: aload_0
       1: checkcast     #76                 // class java/lang/CharSequence
       4: iconst_1
       5: anewarray     #65                 // class java/lang/String
       8: astore_1
       9: aload_1
      10: iconst_0
      11: ldc           #78                 // String ,
      13: aastore
      14: aload_1
      15: iconst_0
      16: iconst_0
      17: bipush        6
      19: aconst_null
      20: invokestatic  #84                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      23: checkcast     #86                 // class java/lang/Iterable
      26: astore_1
      27: nop
      28: iconst_0
      29: istore_2
      30: aload_1
      31: astore_3
      32: new           #88                 // class java/util/ArrayList
      35: dup
      36: aload_1
      37: bipush        10
      39: invokestatic  #94                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      42: invokespecial #96                 // Method java/util/ArrayList."<init>":(I)V
      45: checkcast     #98                 // class java/util/Collection
      48: astore        4
      50: iconst_0
      51: istore        5
      53: aload_3
      54: invokeinterface #102,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      59: astore        6
      61: aload         6
      63: invokeinterface #108,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      68: ifeq          133
      71: aload         6
      73: invokeinterface #112,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      78: astore        7
      80: aload         4
      82: aload         7
      84: checkcast     #65                 // class java/lang/String
      87: astore        8
      89: astore        12
      91: iconst_0
      92: istore        9
      94: aload         8
      96: checkcast     #76                 // class java/lang/CharSequence
      99: iconst_1
     100: anewarray     #65                 // class java/lang/String
     103: astore        10
     105: aload         10
     107: iconst_0
     108: ldc           #114                // String -
     110: aastore
     111: aload         10
     113: iconst_0
     114: iconst_0
     115: bipush        6
     117: aconst_null
     118: invokestatic  #84                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
     121: aload         12
     123: swap
     124: invokeinterface #118,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     129: pop
     130: goto          61
     133: aload         4
     135: checkcast     #67                 // class java/util/List
     138: nop
     139: checkcast     #86                 // class java/lang/Iterable
     142: astore_1
     143: nop
     144: iconst_0
     145: istore_2
     146: aload_1
     147: astore_3
     148: new           #88                 // class java/util/ArrayList
     151: dup
     152: aload_1
     153: bipush        10
     155: invokestatic  #94                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     158: invokespecial #96                 // Method java/util/ArrayList."<init>":(I)V
     161: checkcast     #98                 // class java/util/Collection
     164: astore        4
     166: iconst_0
     167: istore        5
     169: aload_3
     170: invokeinterface #102,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     175: astore        6
     177: aload         6
     179: invokeinterface #108,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     184: ifeq          265
     187: aload         6
     189: invokeinterface #112,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     194: astore        7
     196: aload         4
     198: aload         7
     200: checkcast     #67                 // class java/util/List
     203: astore        8
     205: astore        12
     207: iconst_0
     208: istore        9
     210: aload         8
     212: iconst_0
     213: invokeinterface #122,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     218: checkcast     #65                 // class java/lang/String
     221: astore        10
     223: aload         8
     225: iconst_1
     226: invokeinterface #122,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     231: checkcast     #65                 // class java/lang/String
     234: astore        11
     236: new           #124                // class kotlin/ranges/IntRange
     239: dup
     240: aload         10
     242: invokestatic  #130                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     245: aload         11
     247: invokestatic  #130                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     250: invokespecial #133                // Method kotlin/ranges/IntRange."<init>":(II)V
     253: aload         12
     255: swap
     256: invokeinterface #118,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     261: pop
     262: goto          177
     265: aload         4
     267: checkcast     #67                 // class java/util/List
     270: nop
     271: areturn

  private static final int main$part1(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: checkcast     #86                 // class java/lang/Iterable
       4: astore_1
       5: iconst_0
       6: istore_2
       7: aload_1
       8: astore_3
       9: new           #88                 // class java/util/ArrayList
      12: dup
      13: aload_1
      14: bipush        10
      16: invokestatic  #94                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      19: invokespecial #96                 // Method java/util/ArrayList."<init>":(I)V
      22: checkcast     #98                 // class java/util/Collection
      25: astore        4
      27: iconst_0
      28: istore        5
      30: aload_3
      31: invokeinterface #102,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      36: astore        6
      38: aload         6
      40: invokeinterface #108,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      45: ifeq          88
      48: aload         6
      50: invokeinterface #112,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      55: astore        7
      57: aload         4
      59: aload         7
      61: checkcast     #65                 // class java/lang/String
      64: astore        8
      66: astore        10
      68: iconst_0
      69: istore        9
      71: aload         8
      73: invokestatic  #151                // Method main$assignmentsAsIntRanges:(Ljava/lang/String;)Ljava/util/List;
      76: aload         10
      78: swap
      79: invokeinterface #118,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      84: pop
      85: goto          38
      88: aload         4
      90: checkcast     #67                 // class java/util/List
      93: nop
      94: checkcast     #86                 // class java/lang/Iterable
      97: astore_1
      98: nop
      99: iconst_0
     100: istore_2
     101: aload_1
     102: instanceof    #98                 // class java/util/Collection
     105: ifeq          124
     108: aload_1
     109: checkcast     #98                 // class java/util/Collection
     112: invokeinterface #154,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     117: ifeq          124
     120: iconst_0
     121: goto          253
     124: iconst_0
     125: istore_3
     126: aload_1
     127: invokeinterface #102,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     132: astore        4
     134: aload         4
     136: invokeinterface #108,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     141: ifeq          252
     144: aload         4
     146: invokeinterface #112,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     151: astore        5
     153: aload         5
     155: checkcast     #67                 // class java/util/List
     158: astore        6
     160: iconst_0
     161: istore        7
     163: aload         6
     165: iconst_0
     166: invokeinterface #122,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     171: checkcast     #124                // class kotlin/ranges/IntRange
     174: astore        8
     176: aload         6
     178: iconst_1
     179: invokeinterface #122,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     184: checkcast     #124                // class kotlin/ranges/IntRange
     187: astore        9
     189: aload         8
     191: checkcast     #86                 // class java/lang/Iterable
     194: aload         9
     196: checkcast     #86                 // class java/lang/Iterable
     199: invokestatic  #158                // Method kotlin/collections/CollectionsKt.minus:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/List;
     202: invokeinterface #159,  1          // InterfaceMethod java/util/List.isEmpty:()Z
     207: ifne          231
     210: aload         9
     212: checkcast     #86                 // class java/lang/Iterable
     215: aload         8
     217: checkcast     #86                 // class java/lang/Iterable
     220: invokestatic  #158                // Method kotlin/collections/CollectionsKt.minus:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/List;
     223: invokeinterface #159,  1          // InterfaceMethod java/util/List.isEmpty:()Z
     228: ifeq          235
     231: iconst_1
     232: goto          236
     235: iconst_0
     236: ifeq          134
     239: iinc          3, 1
     242: iload_3
     243: ifge          134
     246: invokestatic  #162                // Method kotlin/collections/CollectionsKt.throwCountOverflow:()V
     249: goto          134
     252: iload_3
     253: ireturn

  private static final int main$part2(java.util.List<java.lang.String>);
    Code:
       0: aload_0
       1: checkcast     #86                 // class java/lang/Iterable
       4: astore_1
       5: iconst_0
       6: istore_2
       7: aload_1
       8: astore_3
       9: new           #88                 // class java/util/ArrayList
      12: dup
      13: aload_1
      14: bipush        10
      16: invokestatic  #94                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      19: invokespecial #96                 // Method java/util/ArrayList."<init>":(I)V
      22: checkcast     #98                 // class java/util/Collection
      25: astore        4
      27: iconst_0
      28: istore        5
      30: aload_3
      31: invokeinterface #102,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      36: astore        6
      38: aload         6
      40: invokeinterface #108,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      45: ifeq          88
      48: aload         6
      50: invokeinterface #112,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      55: astore        7
      57: aload         4
      59: aload         7
      61: checkcast     #65                 // class java/lang/String
      64: astore        8
      66: astore        10
      68: iconst_0
      69: istore        9
      71: aload         8
      73: invokestatic  #151                // Method main$assignmentsAsIntRanges:(Ljava/lang/String;)Ljava/util/List;
      76: aload         10
      78: swap
      79: invokeinterface #118,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      84: pop
      85: goto          38
      88: aload         4
      90: checkcast     #67                 // class java/util/List
      93: nop
      94: checkcast     #86                 // class java/lang/Iterable
      97: astore_1
      98: nop
      99: iconst_0
     100: istore_2
     101: aload_1
     102: instanceof    #98                 // class java/util/Collection
     105: ifeq          124
     108: aload_1
     109: checkcast     #98                 // class java/util/Collection
     112: invokeinterface #154,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     117: ifeq          124
     120: iconst_0
     121: goto          236
     124: iconst_0
     125: istore_3
     126: aload_1
     127: invokeinterface #102,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     132: astore        4
     134: aload         4
     136: invokeinterface #108,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
     141: ifeq          235
     144: aload         4
     146: invokeinterface #112,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     151: astore        5
     153: aload         5
     155: checkcast     #67                 // class java/util/List
     158: astore        6
     160: iconst_0
     161: istore        7
     163: aload         6
     165: iconst_0
     166: invokeinterface #122,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     171: checkcast     #124                // class kotlin/ranges/IntRange
     174: astore        8
     176: aload         6
     178: iconst_1
     179: invokeinterface #122,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     184: checkcast     #124                // class kotlin/ranges/IntRange
     187: astore        9
     189: aload         8
     191: checkcast     #86                 // class java/lang/Iterable
     194: aload         9
     196: checkcast     #86                 // class java/lang/Iterable
     199: invokestatic  #176                // Method kotlin/collections/CollectionsKt.intersect:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/util/Set;
     202: checkcast     #98                 // class java/util/Collection
     205: invokeinterface #154,  1          // InterfaceMethod java/util/Collection.isEmpty:()Z
     210: ifne          217
     213: iconst_1
     214: goto          218
     217: iconst_0
     218: nop
     219: ifeq          134
     222: iinc          3, 1
     225: iload_3
     226: ifge          134
     229: invokestatic  #162                // Method kotlin/collections/CollectionsKt.throwCountOverflow:()V
     232: goto          134
     235: iload_3
     236: ireturn
}