fun <T, C : MutableCollection<T>> Iterable<T>.partitionTo(
    first: C,
    second: C,
    predicate: (T) -> Boolean
): Pair<C, C> =
    this.partition(predicate)
        .let {
            first.addAll(it.first)
            second.addAll(it.second)
            first to second
        }

fun partitionWordsAndLines() {
    val (words, lines) = listOf("a", "a b", "c", "d e")
        .partitionTo(ArrayList(), ArrayList()) { s -> !s.contains(" ") }
    check(words == listOf("a", "c"))
    check(lines == listOf("a b", "d e"))
}

fun partitionLettersAndOtherSymbols() {
    val (letters, other) = setOf('a', '%', 'r', '}')
        .partitionTo(HashSet(), HashSet()) { c -> c in 'a'..'z' || c in 'A'..'Z' }
    check(letters == setOf('a', 'r'))
    check(other == setOf('%', '}'))
}

Compiled from "Task.kt"
public final class TaskKt {
  public static final <T, C extends java.util.Collection<T>> kotlin.Pair<C, C> partitionTo(java.lang.Iterable<? extends T>, C, C, kotlin.jvm.functions.Function1<? super T, java.lang.Boolean>);
    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_1
       7: ldc           #18                 // String first
       9: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_2
      13: ldc           #20                 // String second
      15: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      18: aload_3
      19: ldc           #22                 // String predicate
      21: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      24: aload_0
      25: astore        4
      27: iconst_0
      28: istore        5
      30: new           #24                 // class java/util/ArrayList
      33: dup
      34: invokespecial #28                 // Method java/util/ArrayList."<init>":()V
      37: astore        6
      39: new           #24                 // class java/util/ArrayList
      42: dup
      43: invokespecial #28                 // Method java/util/ArrayList."<init>":()V
      46: astore        7
      48: aload         4
      50: invokeinterface #34,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      55: astore        8
      57: aload         8
      59: invokeinterface #40,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      64: ifeq          114
      67: aload         8
      69: invokeinterface #44,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      74: astore        9
      76: aload_3
      77: aload         9
      79: invokeinterface #50,  2           // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;
      84: checkcast     #52                 // class java/lang/Boolean
      87: invokevirtual #55                 // Method java/lang/Boolean.booleanValue:()Z
      90: ifeq          103
      93: aload         6
      95: aload         9
      97: invokevirtual #59                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     100: goto          110
     103: aload         7
     105: aload         9
     107: invokevirtual #59                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     110: pop
     111: goto          57
     114: new           #61                 // class kotlin/Pair
     117: dup
     118: aload         6
     120: aload         7
     122: invokespecial #64                 // Method kotlin/Pair."<init>":(Ljava/lang/Object;Ljava/lang/Object;)V
     125: astore        5
     127: iconst_0
     128: istore        6
     130: aload_1
     131: aload         5
     133: invokevirtual #67                 // Method kotlin/Pair.getFirst:()Ljava/lang/Object;
     136: checkcast     #69                 // class java/util/Collection
     139: invokeinterface #73,  2           // InterfaceMethod java/util/Collection.addAll:(Ljava/util/Collection;)Z
     144: pop
     145: aload_2
     146: aload         5
     148: invokevirtual #76                 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     151: checkcast     #69                 // class java/util/Collection
     154: invokeinterface #73,  2           // InterfaceMethod java/util/Collection.addAll:(Ljava/util/Collection;)Z
     159: pop
     160: aload_1
     161: aload_2
     162: invokestatic  #82                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     165: nop
     166: areturn

  public static final void partitionWordsAndLines();
    Code:
       0: iconst_4
       1: anewarray     #100                // class java/lang/String
       4: astore_1
       5: aload_1
       6: iconst_0
       7: ldc           #102                // String a
       9: aastore
      10: aload_1
      11: iconst_1
      12: ldc           #104                // String a b
      14: aastore
      15: aload_1
      16: iconst_2
      17: ldc           #106                // String c
      19: aastore
      20: aload_1
      21: iconst_3
      22: ldc           #108                // String d e
      24: aastore
      25: aload_1
      26: invokestatic  #114                // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
      29: checkcast     #30                 // class java/lang/Iterable
      32: new           #24                 // class java/util/ArrayList
      35: dup
      36: invokespecial #28                 // Method java/util/ArrayList."<init>":()V
      39: checkcast     #69                 // class java/util/Collection
      42: new           #24                 // class java/util/ArrayList
      45: dup
      46: invokespecial #28                 // Method java/util/ArrayList."<init>":()V
      49: checkcast     #69                 // class java/util/Collection
      52: invokedynamic #132,  0            // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;
      57: invokestatic  #134                // Method partitionTo:(Ljava/lang/Iterable;Ljava/util/Collection;Ljava/util/Collection;Lkotlin/jvm/functions/Function1;)Lkotlin/Pair;
      60: astore_0
      61: aload_0
      62: invokevirtual #137                // Method kotlin/Pair.component1:()Ljava/lang/Object;
      65: checkcast     #24                 // class java/util/ArrayList
      68: astore_1
      69: aload_0
      70: invokevirtual #140                // Method kotlin/Pair.component2:()Ljava/lang/Object;
      73: checkcast     #24                 // class java/util/ArrayList
      76: astore_2
      77: aload_1
      78: iconst_2
      79: anewarray     #100                // class java/lang/String
      82: astore_3
      83: aload_3
      84: iconst_0
      85: ldc           #102                // String a
      87: aastore
      88: aload_3
      89: iconst_1
      90: ldc           #106                // String c
      92: aastore
      93: aload_3
      94: invokestatic  #114                // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
      97: invokestatic  #144                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     100: ifne          113
     103: new           #146                // class java/lang/IllegalStateException
     106: dup
     107: ldc           #148                // String Check failed.
     109: invokespecial #151                // Method java/lang/IllegalStateException."<init>":(Ljava/lang/String;)V
     112: athrow
     113: aload_2
     114: iconst_2
     115: anewarray     #100                // class java/lang/String
     118: astore_3
     119: aload_3
     120: iconst_0
     121: ldc           #104                // String a b
     123: aastore
     124: aload_3
     125: iconst_1
     126: ldc           #108                // String d e
     128: aastore
     129: aload_3
     130: invokestatic  #114                // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
     133: invokestatic  #144                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     136: ifne          149
     139: new           #146                // class java/lang/IllegalStateException
     142: dup
     143: ldc           #148                // String Check failed.
     145: invokespecial #151                // Method java/lang/IllegalStateException."<init>":(Ljava/lang/String;)V
     148: athrow
     149: return

  public static final void partitionLettersAndOtherSymbols();
    Code:
       0: iconst_4
       1: anewarray     #158                // class java/lang/Character
       4: astore_1
       5: aload_1
       6: iconst_0
       7: bipush        97
       9: invokestatic  #162                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      12: aastore
      13: aload_1
      14: iconst_1
      15: bipush        37
      17: invokestatic  #162                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      20: aastore
      21: aload_1
      22: iconst_2
      23: bipush        114
      25: invokestatic  #162                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      28: aastore
      29: aload_1
      30: iconst_3
      31: bipush        125
      33: invokestatic  #162                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
      36: aastore
      37: aload_1
      38: invokestatic  #168                // Method kotlin/collections/SetsKt.setOf:([Ljava/lang/Object;)Ljava/util/Set;
      41: checkcast     #30                 // class java/lang/Iterable
      44: new           #170                // class java/util/HashSet
      47: dup
      48: invokespecial #171                // Method java/util/HashSet."<init>":()V
      51: checkcast     #69                 // class java/util/Collection
      54: new           #170                // class java/util/HashSet
      57: dup
      58: invokespecial #171                // Method java/util/HashSet."<init>":()V
      61: checkcast     #69                 // class java/util/Collection
      64: invokedynamic #179,  0            // InvokeDynamic #1:invoke:()Lkotlin/jvm/functions/Function1;
      69: invokestatic  #134                // Method partitionTo:(Ljava/lang/Iterable;Ljava/util/Collection;Ljava/util/Collection;Lkotlin/jvm/functions/Function1;)Lkotlin/Pair;
      72: astore_0
      73: aload_0
      74: invokevirtual #137                // Method kotlin/Pair.component1:()Ljava/lang/Object;
      77: checkcast     #170                // class java/util/HashSet
      80: astore_1
      81: aload_0
      82: invokevirtual #140                // Method kotlin/Pair.component2:()Ljava/lang/Object;
      85: checkcast     #170                // class java/util/HashSet
      88: astore_2
      89: aload_1
      90: iconst_2
      91: anewarray     #158                // class java/lang/Character
      94: astore_3
      95: aload_3
      96: iconst_0
      97: bipush        97
      99: invokestatic  #162                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     102: aastore
     103: aload_3
     104: iconst_1
     105: bipush        114
     107: invokestatic  #162                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     110: aastore
     111: aload_3
     112: invokestatic  #168                // Method kotlin/collections/SetsKt.setOf:([Ljava/lang/Object;)Ljava/util/Set;
     115: invokestatic  #144                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     118: ifne          131
     121: new           #146                // class java/lang/IllegalStateException
     124: dup
     125: ldc           #148                // String Check failed.
     127: invokespecial #151                // Method java/lang/IllegalStateException."<init>":(Ljava/lang/String;)V
     130: athrow
     131: aload_2
     132: iconst_2
     133: anewarray     #158                // class java/lang/Character
     136: astore_3
     137: aload_3
     138: iconst_0
     139: bipush        37
     141: invokestatic  #162                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     144: aastore
     145: aload_3
     146: iconst_1
     147: bipush        125
     149: invokestatic  #162                // Method java/lang/Character.valueOf:(C)Ljava/lang/Character;
     152: aastore
     153: aload_3
     154: invokestatic  #168                // Method kotlin/collections/SetsKt.setOf:([Ljava/lang/Object;)Ljava/util/Set;
     157: invokestatic  #144                // Method kotlin/jvm/internal/Intrinsics.areEqual:(Ljava/lang/Object;Ljava/lang/Object;)Z
     160: ifne          173
     163: new           #146                // class java/lang/IllegalStateException
     166: dup
     167: ldc           #148                // String Check failed.
     169: invokespecial #151                // Method java/lang/IllegalStateException."<init>":(Ljava/lang/String;)V
     172: athrow
     173: return

  private static final boolean partitionWordsAndLines$lambda$1(java.lang.String);
    Code:
       0: aload_0
       1: ldc           #186                // String s
       3: invokestatic  #16                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: checkcast     #188                // class java/lang/CharSequence
      10: ldc           #190                // String
      12: checkcast     #188                // class java/lang/CharSequence
      15: iconst_0
      16: iconst_2
      17: aconst_null
      18: invokestatic  #196                // Method kotlin/text/StringsKt.contains$default:(Ljava/lang/CharSequence;Ljava/lang/CharSequence;ZILjava/lang/Object;)Z
      21: ifne          28
      24: iconst_1
      25: goto          29
      28: iconst_0
      29: ireturn

  private static final boolean partitionLettersAndOtherSymbols$lambda$2(char);
    Code:
       0: bipush        97
       2: iload_0
       3: if_icmpgt     20
       6: iload_0
       7: bipush        123
       9: if_icmpge     16
      12: iconst_1
      13: goto          21
      16: iconst_0
      17: goto          21
      20: iconst_0
      21: ifne          48
      24: bipush        65
      26: iload_0
      27: if_icmpgt     44
      30: iload_0
      31: bipush        91
      33: if_icmpge     40
      36: iconst_1
      37: goto          45
      40: iconst_0
      41: goto          45
      44: iconst_0
      45: ifeq          52
      48: iconst_1
      49: goto          53
      52: iconst_0
      53: ireturn
}


fun main(args: Array<String>) {
    //Input the array in the format num1 num2 num3 num4 etc
    print("Enter the elements for the Array: ")
    var inputArray = readLine()!!.trim().split(" ").map { it -> it.toInt() }.toIntArray()

    var sortedArray = selectionSort(inputArray)
    println(sortedArray.contentToString())
}

fun selectionSort(arr: IntArray): IntArray {
    for (i in arr.lastIndex downTo 0) {
        var max = arr[0]
        var maxIndex = 0
        for (j in 0..i) {
            if (arr[maxIndex]<arr[j])
                maxIndex = j
        }
        val temp = arr[maxIndex]
        arr[maxIndex] = arr[i]
        arr[i] = temp
    }
    return arr
}

//Sample
//Input:   Enter the elements for the Array: 64 23 -12 -5 0 2 89 20 100 32 650 -230 130
//Output:   [-230, -12, -5, 0, 2, 20, 23, 32, 64, 89, 100, 130, 650]

//Time Complexity:  Worst Case: O(n^2)   Best Case: O(n^2)
//Space Complexity: O(1)

Compiled from "SelectionSort.kt"
public final class SelectionSortKt {
  public static final void main(java.lang.String[]);
    Code:
       0: aload_0
       1: ldc           #9                  // String args
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: ldc           #17                 // String Enter the elements for the Array:
       8: getstatic     #23                 // Field java/lang/System.out:Ljava/io/PrintStream;
      11: swap
      12: invokevirtual #29                 // Method java/io/PrintStream.print:(Ljava/lang/Object;)V
      15: invokestatic  #35                 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;
      18: dup
      19: invokestatic  #38                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      22: checkcast     #40                 // class java/lang/CharSequence
      25: invokestatic  #46                 // Method kotlin/text/StringsKt.trim:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
      28: invokevirtual #49                 // Method java/lang/Object.toString:()Ljava/lang/String;
      31: checkcast     #40                 // class java/lang/CharSequence
      34: iconst_1
      35: anewarray     #51                 // class java/lang/String
      38: astore_2
      39: aload_2
      40: iconst_0
      41: ldc           #53                 // String
      43: aastore
      44: aload_2
      45: iconst_0
      46: iconst_0
      47: bipush        6
      49: aconst_null
      50: invokestatic  #57                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      53: checkcast     #59                 // class java/lang/Iterable
      56: astore_2
      57: iconst_0
      58: istore_3
      59: aload_2
      60: astore        4
      62: new           #61                 // class java/util/ArrayList
      65: dup
      66: aload_2
      67: bipush        10
      69: invokestatic  #67                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      72: invokespecial #71                 // Method java/util/ArrayList."<init>":(I)V
      75: checkcast     #73                 // class java/util/Collection
      78: astore        5
      80: iconst_0
      81: istore        6
      83: aload         4
      85: invokeinterface #77,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      90: astore        7
      92: aload         7
      94: invokeinterface #83,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      99: ifeq          146
     102: aload         7
     104: invokeinterface #87,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     109: astore        8
     111: aload         5
     113: aload         8
     115: checkcast     #51                 // class java/lang/String
     118: astore        9
     120: astore        11
     122: iconst_0
     123: istore        10
     125: aload         9
     127: invokestatic  #93                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
     130: nop
     131: invokestatic  #97                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     134: aload         11
     136: swap
     137: invokeinterface #101,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     142: pop
     143: goto          92
     146: aload         5
     148: checkcast     #103                // class java/util/List
     151: nop
     152: checkcast     #73                 // class java/util/Collection
     155: invokestatic  #107                // Method kotlin/collections/CollectionsKt.toIntArray:(Ljava/util/Collection;)[I
     158: astore_1
     159: aload_1
     160: invokestatic  #111                // Method selectionSort:([I)[I
     163: astore_2
     164: aload_2
     165: invokestatic  #116                // Method java/util/Arrays.toString:([I)Ljava/lang/String;
     168: dup
     169: ldc           #118                // String toString(...)
     171: invokestatic  #121                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     174: astore_3
     175: getstatic     #23                 // Field java/lang/System.out:Ljava/io/PrintStream;
     178: aload_3
     179: invokevirtual #124                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     182: return

  public static final int[] selectionSort(int[]);
    Code:
       0: aload_0
       1: ldc           #144                // String arr
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: invokestatic  #150                // Method kotlin/collections/ArraysKt.getLastIndex:([I)I
      10: istore_1
      11: iconst_m1
      12: iload_1
      13: if_icmpge     78
      16: aload_0
      17: iconst_0
      18: iaload
      19: istore_2
      20: iconst_0
      21: istore_3
      22: iconst_0
      23: istore        4
      25: iload         4
      27: iload_1
      28: if_icmpgt     56
      31: aload_0
      32: iload_3
      33: iaload
      34: aload_0
      35: iload         4
      37: iaload
      38: if_icmpge     44
      41: iload         4
      43: istore_3
      44: iload         4
      46: iload_1
      47: if_icmpeq     56
      50: iinc          4, 1
      53: goto          31
      56: aload_0
      57: iload_3
      58: iaload
      59: istore        4
      61: aload_0
      62: iload_3
      63: aload_0
      64: iload_1
      65: iaload
      66: iastore
      67: aload_0
      68: iload_1
      69: iload         4
      71: iastore
      72: iinc          1, -1
      75: goto          11
      78: aload_0
      79: areturn
}


import java.lang.Math.floor
import java.lang.Math.max
import javax.script.ScriptEngine
import javax.script.ScriptEngineManager

data class Expression(val expression: String)

fun main(args:Array<String>) {
    while (true) {
        println("---------------------------")
        println("Separate numbers by comma.")
        print("Enter numbers: ")

        val inputNumbers = readLine()!!.split(",").map { it.trim().toDouble() }
        val formula = findFormula(inputNumbers)
        println("Formula: $formula")
        println("Pattern: " + continuePattern(formula))
    }
}

private fun findFormula(numbers: List<Double>): String {
    // Find difference between numbers
    val differences = listOf(
            numbers[1] - numbers[0],
            numbers[2] - numbers[1]
    )

    var incrementsByDifference = true
    var increment = 0.0
    if (differences[0] != differences[1]) // If the pattern doesn't increment by difference
        incrementsByDifference = false
    else
        increment = differences[0]

    // Start-value
    val nAsExponent = nAsExponent(differences, numbers)
    val startValueDifference = when {
        incrementsByDifference -> differences[0]             // xn
        nAsExponent            -> getBase(differences) // x^n
        else                   -> 1.0                        // n^x
    }

    val startValue = numbers[0] - startValueDifference

    // Exponents
    var base = "n"
    var exponent = ""
    if (nAsExponent(differences, numbers)) {
        base = getBase(differences).cleanRedundancy() + "^"
        exponent = "n"
    } else if (!incrementsByDifference) {
        base = "n^"
        exponent = getExponent(numbers[1], startValue).cleanRedundancy()
    }

    // Add the pieces together
    var formula = increment.cleanRedundancy()
    formula += base + exponent + startValue.cleanRedundancy().addSign()

    return formula
}

private fun continuePattern(formula: String): String {
    var output = ""
    for (i in 1..20) {
        val expression = Expression(formula.replace("n", i.toString()))
        output += expression.calculate().cleanRedundancy() + ", "
    }

    return output.cleanRedundancy()
}

fun Double.cleanRedundancy(): String {
    return when {
        this == 0.0         -> return ""
        floor(this) == this -> this.toInt().toString()
        else                -> return this.toString()
    }
}

fun String.cleanRedundancy(): String {
    return if (this.endsWith(", "))
        this.substring(0, this.length - 3)
    else
        this
}

fun String.addSign(): String {
    return if (!this.startsWith("-"))
        "+" + this
    else
        this
}

fun Expression.calculate(): Double {
    val addSubSign = max(expression.indexOf("+"), expression.indexOf("-"))
    val addSub = expression.substring(addSubSign + 1, expression.length).toDouble()
    val numbers = expression.substring(0, addSubSign)
            .split(Regex("[*^]")).map { it.toDouble() }

    if (expression.contains("*"))
        return numbers[0] * numbers[1] + addSub
    else if (expression.contains("^"))
        return Math.pow(numbers[0], numbers[1]) + addSub
    return 0.0
}

private fun getBase(differences: List<Double>): Double {
    return differences[1] / differences[0]
}

private fun getExponent(secondNumber: Double, startValue: Double): Double {
    return Math.log(secondNumber - startValue) / Math.log(2.0)
}

private fun nAsExponent(differences: List<Double>, numbers: List<Double>): Boolean {
    val base = getBase(differences)
    return  Math.log(numbers[1] - (base - 1)) / Math.log(base)  == 2.0
}

Compiled from "PatternFinder.kt"
public final class PatternFinderKt {
  public static final void main(java.lang.String[]);
    Code:
       0: aload_0
       1: ldc           #9                  // String args
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: nop
       7: ldc           #17                 // String ---------------------------
       9: getstatic     #23                 // Field java/lang/System.out:Ljava/io/PrintStream;
      12: swap
      13: invokevirtual #29                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      16: ldc           #31                 // String Separate numbers by comma.
      18: getstatic     #23                 // Field java/lang/System.out:Ljava/io/PrintStream;
      21: swap
      22: invokevirtual #29                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      25: ldc           #33                 // String Enter numbers:
      27: getstatic     #23                 // Field java/lang/System.out:Ljava/io/PrintStream;
      30: swap
      31: invokevirtual #36                 // Method java/io/PrintStream.print:(Ljava/lang/Object;)V
      34: invokestatic  #42                 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;
      37: dup
      38: invokestatic  #45                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
      41: checkcast     #47                 // class java/lang/CharSequence
      44: iconst_1
      45: anewarray     #49                 // class java/lang/String
      48: astore_2
      49: aload_2
      50: iconst_0
      51: ldc           #51                 // String ,
      53: aastore
      54: aload_2
      55: iconst_0
      56: iconst_0
      57: bipush        6
      59: aconst_null
      60: invokestatic  #57                 // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      63: checkcast     #59                 // class java/lang/Iterable
      66: astore_2
      67: iconst_0
      68: istore_3
      69: aload_2
      70: astore        4
      72: new           #61                 // class java/util/ArrayList
      75: dup
      76: aload_2
      77: bipush        10
      79: invokestatic  #67                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      82: invokespecial #71                 // Method java/util/ArrayList."<init>":(I)V
      85: checkcast     #73                 // class java/util/Collection
      88: astore        5
      90: iconst_0
      91: istore        6
      93: aload         4
      95: invokeinterface #77,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     100: astore        7
     102: aload         7
     104: invokeinterface #83,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     109: ifeq          166
     112: aload         7
     114: invokeinterface #87,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     119: astore        8
     121: aload         5
     123: aload         8
     125: checkcast     #49                 // class java/lang/String
     128: astore        9
     130: astore        11
     132: iconst_0
     133: istore        10
     135: nop
     136: aload         9
     138: checkcast     #47                 // class java/lang/CharSequence
     141: invokestatic  #91                 // Method kotlin/text/StringsKt.trim:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
     144: invokevirtual #94                 // Method java/lang/Object.toString:()Ljava/lang/String;
     147: invokestatic  #100                // Method java/lang/Double.parseDouble:(Ljava/lang/String;)D
     150: nop
     151: invokestatic  #104                // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     154: aload         11
     156: swap
     157: invokeinterface #108,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     162: pop
     163: goto          102
     166: aload         5
     168: checkcast     #110                // class java/util/List
     171: nop
     172: astore_1
     173: aload_1
     174: invokestatic  #114                // Method findFormula:(Ljava/util/List;)Ljava/lang/String;
     177: astore_2
     178: new           #116                // class java/lang/StringBuilder
     181: dup
     182: invokespecial #119                // Method java/lang/StringBuilder."<init>":()V
     185: ldc           #121                // String Formula:
     187: invokevirtual #125                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     190: aload_2
     191: invokevirtual #125                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     194: invokevirtual #126                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     197: getstatic     #23                 // Field java/lang/System.out:Ljava/io/PrintStream;
     200: swap
     201: invokevirtual #29                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     204: new           #116                // class java/lang/StringBuilder
     207: dup
     208: invokespecial #119                // Method java/lang/StringBuilder."<init>":()V
     211: ldc           #128                // String Pattern:
     213: invokevirtual #125                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     216: aload_2
     217: invokestatic  #132                // Method continuePattern:(Ljava/lang/String;)Ljava/lang/String;
     220: invokevirtual #125                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     223: invokevirtual #126                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     226: getstatic     #23                 // Field java/lang/System.out:Ljava/io/PrintStream;
     229: swap
     230: invokevirtual #29                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     233: goto          6

  private static final java.lang.String findFormula(java.util.List<java.lang.Double>);
    Code:
       0: iconst_2
       1: anewarray     #96                 // class java/lang/Double
       4: astore_2
       5: aload_2
       6: iconst_0
       7: aload_0
       8: iconst_1
       9: invokeinterface #155,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      14: checkcast     #157                // class java/lang/Number
      17: invokevirtual #161                // Method java/lang/Number.doubleValue:()D
      20: aload_0
      21: iconst_0
      22: invokeinterface #155,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      27: checkcast     #157                // class java/lang/Number
      30: invokevirtual #161                // Method java/lang/Number.doubleValue:()D
      33: dsub
      34: invokestatic  #104                // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
      37: aastore
      38: aload_2
      39: iconst_1
      40: aload_0
      41: iconst_2
      42: invokeinterface #155,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      47: checkcast     #157                // class java/lang/Number
      50: invokevirtual #161                // Method java/lang/Number.doubleValue:()D
      53: aload_0
      54: iconst_1
      55: invokeinterface #155,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      60: checkcast     #157                // class java/lang/Number
      63: invokevirtual #161                // Method java/lang/Number.doubleValue:()D
      66: dsub
      67: invokestatic  #104                // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
      70: aastore
      71: aload_2
      72: invokestatic  #165                // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
      75: astore_1
      76: iconst_1
      77: istore_2
      78: dconst_0
      79: dstore_3
      80: aload_1
      81: iconst_0
      82: invokeinterface #155,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      87: checkcast     #157                // class java/lang/Number
      90: invokevirtual #161                // Method java/lang/Number.doubleValue:()D
      93: aload_1
      94: iconst_1
      95: invokeinterface #155,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     100: checkcast     #157                // class java/lang/Number
     103: invokevirtual #161                // Method java/lang/Number.doubleValue:()D
     106: dcmpg
     107: ifne          114
     110: iconst_1
     111: goto          115
     114: iconst_0
     115: ifne          123
     118: iconst_0
     119: istore_2
     120: goto          137
     123: aload_1
     124: iconst_0
     125: invokeinterface #155,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     130: checkcast     #157                // class java/lang/Number
     133: invokevirtual #161                // Method java/lang/Number.doubleValue:()D
     136: dstore_3
     137: aload_1
     138: aload_0
     139: invokestatic  #169                // Method nAsExponent:(Ljava/util/List;Ljava/util/List;)Z
     142: istore        5
     144: nop
     145: iload_2
     146: ifeq          165
     149: aload_1
     150: iconst_0
     151: invokeinterface #155,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     156: checkcast     #157                // class java/lang/Number
     159: invokevirtual #161                // Method java/lang/Number.doubleValue:()D
     162: goto          178
     165: iload         5
     167: ifeq          177
     170: aload_1
     171: invokestatic  #173                // Method getBase:(Ljava/util/List;)D
     174: goto          178
     177: dconst_1
     178: dstore        6
     180: aload_0
     181: iconst_0
     182: invokeinterface #155,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     187: checkcast     #157                // class java/lang/Number
     190: invokevirtual #161                // Method java/lang/Number.doubleValue:()D
     193: dload         6
     195: dsub
     196: dstore        8
     198: ldc           #175                // String n
     200: astore        10
     202: ldc           #177                // String
     204: astore        11
     206: aload_1
     207: aload_0
     208: invokestatic  #169                // Method nAsExponent:(Ljava/util/List;Ljava/util/List;)Z
     211: ifeq          248
     214: new           #116                // class java/lang/StringBuilder
     217: dup
     218: invokespecial #119                // Method java/lang/StringBuilder."<init>":()V
     221: aload_1
     222: invokestatic  #173                // Method getBase:(Ljava/util/List;)D
     225: invokestatic  #181                // Method cleanRedundancy:(D)Ljava/lang/String;
     228: invokevirtual #125                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     231: bipush        94
     233: invokevirtual #184                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
     236: invokevirtual #126                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     239: astore        10
     241: ldc           #175                // String n
     243: astore        11
     245: goto          279
     248: iload_2
     249: ifne          279
     252: ldc           #186                // String n^
     254: astore        10
     256: aload_0
     257: iconst_1
     258: invokeinterface #155,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     263: checkcast     #157                // class java/lang/Number
     266: invokevirtual #161                // Method java/lang/Number.doubleValue:()D
     269: dload         8
     271: invokestatic  #190                // Method getExponent:(DD)D
     274: invokestatic  #181                // Method cleanRedundancy:(D)Ljava/lang/String;
     277: astore        11
     279: dload_3
     280: invokestatic  #181                // Method cleanRedundancy:(D)Ljava/lang/String;
     283: astore        12
     285: new           #116                // class java/lang/StringBuilder
     288: dup
     289: invokespecial #119                // Method java/lang/StringBuilder."<init>":()V
     292: aload         12
     294: invokevirtual #125                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     297: aload         10
     299: invokevirtual #125                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     302: aload         11
     304: invokevirtual #125                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     307: dload         8
     309: invokestatic  #181                // Method cleanRedundancy:(D)Ljava/lang/String;
     312: invokestatic  #193                // Method addSign:(Ljava/lang/String;)Ljava/lang/String;
     315: invokevirtual #125                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     318: invokevirtual #126                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     321: astore        12
     323: aload         12
     325: areturn

  private static final java.lang.String continuePattern(java.lang.String);
    Code:
       0: ldc           #177                // String
       2: astore_1
       3: iconst_1
       4: istore_2
       5: iload_2
       6: bipush        21
       8: if_icmpge     68
      11: new           #205                // class Expression
      14: dup
      15: aload_0
      16: ldc           #175                // String n
      18: iload_2
      19: invokestatic  #208                // Method java/lang/String.valueOf:(I)Ljava/lang/String;
      22: iconst_0
      23: iconst_4
      24: aconst_null
      25: invokestatic  #212                // Method kotlin/text/StringsKt.replace$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Ljava/lang/String;
      28: invokespecial #215                // Method Expression."<init>":(Ljava/lang/String;)V
      31: astore_3
      32: new           #116                // class java/lang/StringBuilder
      35: dup
      36: invokespecial #119                // Method java/lang/StringBuilder."<init>":()V
      39: aload_1
      40: invokevirtual #125                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      43: aload_3
      44: invokestatic  #219                // Method calculate:(LExpression;)D
      47: invokestatic  #181                // Method cleanRedundancy:(D)Ljava/lang/String;
      50: invokevirtual #125                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      53: ldc           #221                // String ,
      55: invokevirtual #125                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      58: invokevirtual #126                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      61: astore_1
      62: iinc          2, 1
      65: goto          5
      68: aload_1
      69: invokestatic  #223                // Method cleanRedundancy:(Ljava/lang/String;)Ljava/lang/String;
      72: areturn

  public static final java.lang.String cleanRedundancy(double);
    Code:
       0: nop
       1: dload_0
       2: dconst_0
       3: dcmpg
       4: ifne          11
       7: iconst_1
       8: goto          12
      11: iconst_0
      12: ifeq          18
      15: ldc           #177                // String
      17: areturn
      18: dload_0
      19: invokestatic  #233                // Method java/lang/Math.floor:(D)D
      22: dload_0
      23: dcmpg
      24: ifne          31
      27: iconst_1
      28: goto          32
      31: iconst_0
      32: ifeq          43
      35: dload_0
      36: d2i
      37: invokestatic  #208                // Method java/lang/String.valueOf:(I)Ljava/lang/String;
      40: goto          48
      43: dload_0
      44: invokestatic  #235                // Method java/lang/String.valueOf:(D)Ljava/lang/String;
      47: areturn
      48: areturn

  public static final java.lang.String cleanRedundancy(java.lang.String);
    Code:
       0: aload_0
       1: ldc           #238                // String <this>
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: ldc           #221                // String ,
       9: iconst_0
      10: iconst_2
      11: aconst_null
      12: invokestatic  #242                // Method kotlin/text/StringsKt.endsWith$default:(Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Z
      15: ifeq          38
      18: aload_0
      19: iconst_0
      20: aload_0
      21: invokevirtual #246                // Method java/lang/String.length:()I
      24: iconst_3
      25: isub
      26: invokevirtual #250                // Method java/lang/String.substring:(II)Ljava/lang/String;
      29: dup
      30: ldc           #252                // String substring(...)
      32: invokestatic  #255                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      35: goto          39
      38: aload_0
      39: areturn

  public static final java.lang.String addSign(java.lang.String);
    Code:
       0: aload_0
       1: ldc           #238                // String <this>
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: ldc_w         #257                // String -
      10: iconst_0
      11: iconst_2
      12: aconst_null
      13: invokestatic  #260                // Method kotlin/text/StringsKt.startsWith$default:(Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Z
      16: ifne          41
      19: new           #116                // class java/lang/StringBuilder
      22: dup
      23: invokespecial #119                // Method java/lang/StringBuilder."<init>":()V
      26: bipush        43
      28: invokevirtual #184                // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      31: aload_0
      32: invokevirtual #125                // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      35: invokevirtual #126                // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      38: goto          42
      41: aload_0
      42: areturn

  public static final double calculate(Expression);
    Code:
       0: aload_0
       1: ldc           #238                // String <this>
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: invokevirtual #264                // Method Expression.getExpression:()Ljava/lang/String;
      10: checkcast     #47                 // class java/lang/CharSequence
      13: ldc_w         #266                // String +
      16: iconst_0
      17: iconst_0
      18: bipush        6
      20: aconst_null
      21: invokestatic  #270                // Method kotlin/text/StringsKt.indexOf$default:(Ljava/lang/CharSequence;Ljava/lang/String;IZILjava/lang/Object;)I
      24: aload_0
      25: invokevirtual #264                // Method Expression.getExpression:()Ljava/lang/String;
      28: checkcast     #47                 // class java/lang/CharSequence
      31: ldc_w         #257                // String -
      34: iconst_0
      35: iconst_0
      36: bipush        6
      38: aconst_null
      39: invokestatic  #270                // Method kotlin/text/StringsKt.indexOf$default:(Ljava/lang/CharSequence;Ljava/lang/String;IZILjava/lang/Object;)I
      42: invokestatic  #274                // Method java/lang/Math.max:(II)I
      45: istore_1
      46: nop
      47: aload_0
      48: invokevirtual #264                // Method Expression.getExpression:()Ljava/lang/String;
      51: iload_1
      52: iconst_1
      53: iadd
      54: aload_0
      55: invokevirtual #264                // Method Expression.getExpression:()Ljava/lang/String;
      58: invokevirtual #246                // Method java/lang/String.length:()I
      61: invokevirtual #250                // Method java/lang/String.substring:(II)Ljava/lang/String;
      64: dup
      65: ldc           #252                // String substring(...)
      67: invokestatic  #255                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      70: invokestatic  #100                // Method java/lang/Double.parseDouble:(Ljava/lang/String;)D
      73: dstore_2
      74: aload_0
      75: invokevirtual #264                // Method Expression.getExpression:()Ljava/lang/String;
      78: iconst_0
      79: iload_1
      80: invokevirtual #250                // Method java/lang/String.substring:(II)Ljava/lang/String;
      83: dup
      84: ldc           #252                // String substring(...)
      86: invokestatic  #255                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      89: checkcast     #47                 // class java/lang/CharSequence
      92: astore        5
      94: new           #276                // class kotlin/text/Regex
      97: dup
      98: ldc_w         #278                // String [*^]
     101: invokespecial #279                // Method kotlin/text/Regex."<init>":(Ljava/lang/String;)V
     104: astore        6
     106: iconst_0
     107: istore        7
     109: aload         6
     111: aload         5
     113: iload         7
     115: invokevirtual #283                // Method kotlin/text/Regex.split:(Ljava/lang/CharSequence;I)Ljava/util/List;
     118: checkcast     #59                 // class java/lang/Iterable
     121: astore        5
     123: nop
     124: iconst_0
     125: istore        6
     127: aload         5
     129: astore        7
     131: new           #61                 // class java/util/ArrayList
     134: dup
     135: aload         5
     137: bipush        10
     139: invokestatic  #67                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     142: invokespecial #71                 // Method java/util/ArrayList."<init>":(I)V
     145: checkcast     #73                 // class java/util/Collection
     148: astore        8
     150: iconst_0
     151: istore        9
     153: aload         7
     155: invokeinterface #77,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     160: astore        10
     162: aload         10
     164: invokeinterface #83,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     169: ifeq          216
     172: aload         10
     174: invokeinterface #87,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     179: astore        11
     181: aload         8
     183: aload         11
     185: checkcast     #49                 // class java/lang/String
     188: astore        12
     190: astore        14
     192: iconst_0
     193: istore        13
     195: aload         12
     197: invokestatic  #100                // Method java/lang/Double.parseDouble:(Ljava/lang/String;)D
     200: nop
     201: invokestatic  #104                // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     204: aload         14
     206: swap
     207: invokeinterface #108,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     212: pop
     213: goto          162
     216: aload         8
     218: checkcast     #110                // class java/util/List
     221: nop
     222: astore        4
     224: aload_0
     225: invokevirtual #264                // Method Expression.getExpression:()Ljava/lang/String;
     228: checkcast     #47                 // class java/lang/CharSequence
     231: ldc_w         #285                // String *
     234: checkcast     #47                 // class java/lang/CharSequence
     237: iconst_0
     238: iconst_2
     239: aconst_null
     240: invokestatic  #289                // Method kotlin/text/StringsKt.contains$default:(Ljava/lang/CharSequence;Ljava/lang/CharSequence;ZILjava/lang/Object;)Z
     243: ifeq          278
     246: aload         4
     248: iconst_0
     249: invokeinterface #155,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     254: checkcast     #157                // class java/lang/Number
     257: invokevirtual #161                // Method java/lang/Number.doubleValue:()D
     260: aload         4
     262: iconst_1
     263: invokeinterface #155,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     268: checkcast     #157                // class java/lang/Number
     271: invokevirtual #161                // Method java/lang/Number.doubleValue:()D
     274: dmul
     275: dload_2
     276: dadd
     277: dreturn
     278: aload_0
     279: invokevirtual #264                // Method Expression.getExpression:()Ljava/lang/String;
     282: checkcast     #47                 // class java/lang/CharSequence
     285: ldc_w         #291                // String ^
     288: checkcast     #47                 // class java/lang/CharSequence
     291: iconst_0
     292: iconst_2
     293: aconst_null
     294: invokestatic  #289                // Method kotlin/text/StringsKt.contains$default:(Ljava/lang/CharSequence;Ljava/lang/CharSequence;ZILjava/lang/Object;)Z
     297: ifeq          334
     300: aload         4
     302: iconst_0
     303: invokeinterface #155,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     308: checkcast     #157                // class java/lang/Number
     311: invokevirtual #161                // Method java/lang/Number.doubleValue:()D
     314: aload         4
     316: iconst_1
     317: invokeinterface #155,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     322: checkcast     #157                // class java/lang/Number
     325: invokevirtual #161                // Method java/lang/Number.doubleValue:()D
     328: invokestatic  #294                // Method java/lang/Math.pow:(DD)D
     331: dload_2
     332: dadd
     333: dreturn
     334: dconst_0
     335: dreturn

  private static final double getBase(java.util.List<java.lang.Double>);
    Code:
       0: aload_0
       1: iconst_1
       2: invokeinterface #155,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
       7: checkcast     #157                // class java/lang/Number
      10: invokevirtual #161                // Method java/lang/Number.doubleValue:()D
      13: aload_0
      14: iconst_0
      15: invokeinterface #155,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      20: checkcast     #157                // class java/lang/Number
      23: invokevirtual #161                // Method java/lang/Number.doubleValue:()D
      26: ddiv
      27: dreturn

  private static final double getExponent(double, double);
    Code:
       0: dload_0
       1: dload_2
       2: dsub
       3: invokestatic  #302                // Method java/lang/Math.log:(D)D
       6: ldc2_w        #303                // double 2.0d
       9: invokestatic  #302                // Method java/lang/Math.log:(D)D
      12: ddiv
      13: dreturn

  private static final boolean nAsExponent(java.util.List<java.lang.Double>, java.util.List<java.lang.Double>);
    Code:
       0: aload_0
       1: invokestatic  #173                // Method getBase:(Ljava/util/List;)D
       4: dstore_2
       5: aload_1
       6: iconst_1
       7: invokeinterface #155,  2          // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      12: checkcast     #157                // class java/lang/Number
      15: invokevirtual #161                // Method java/lang/Number.doubleValue:()D
      18: dload_2
      19: iconst_1
      20: i2d
      21: dsub
      22: dsub
      23: invokestatic  #302                // Method java/lang/Math.log:(D)D
      26: dload_2
      27: invokestatic  #302                // Method java/lang/Math.log:(D)D
      30: ddiv
      31: ldc2_w        #303                // double 2.0d
      34: dcmpg
      35: ifne          42
      38: iconst_1
      39: goto          43
      42: iconst_0
      43: ireturn
}


fun main(args: Array<String>) {
    println("Hello Stalin!")
    writeStalinSort(intArrayOf(4))
    writeStalinSort(intArrayOf(6, 2, 5, 7, 3, 8, 8, 4))
    writeStalinSort(intArrayOf(5, 3, 7, 8, 9, 5, 3, 5, 7))
    /**
     * Hello Stalin!
     * Input: 4
     * StalinBy: 4
     * StalinByDescending: 4
     * Input: 6,2,5,7,3,8,8,4
     * StalinBy: 6,7,8,8
     * StalinByDescending: 6,2
     * Input: 5,3,7,8,9,5,3,5,7
     * StalinBy: 5,7,8,9
     * StalinByDescending: 5,3,3
     */
}

private fun writeStalinSort(source: IntArray) {
    println("Input: ${source.joinToString(",")}")
    println("StalinBy: ${source.asSequence().stalinBy().joinToString(",")}")
    println("StalinByDescending: ${source.asSequence().stalinByDescending().joinToString(",")}")
}

fun <T> Sequence<T>.stalinBy(): List<T> where T : Comparable<T> {
    return stalinSort(this, false)
}

fun <T> Sequence<T>.stalinByDescending(): List<T> where T : Comparable<T> {
    return stalinSort(this, true)
}

private fun <T> stalinSort(source: Sequence<T>, descending: Boolean): List<T> where T : Comparable<T> {
    val iterator = source.iterator()
    val result = mutableListOf<T>()

    if (iterator.hasNext()) {
        var lastElement = iterator.next()
        result.add(lastElement)

        while (iterator.hasNext()) {
            val element = iterator.next()
            val compare = when (descending) {
                true -> element <= lastElement
                false -> lastElement <= element
            }
            if (compare) {
                result.add(element)
                lastElement = element
            }
        }
    }

    return result
}

Compiled from "StalinSort.kt"
public final class StalinSortKt {
  public static final void main(java.lang.String[]);
    Code:
       0: aload_0
       1: ldc           #9                  // String args
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: ldc           #17                 // String Hello Stalin!
       8: getstatic     #23                 // Field java/lang/System.out:Ljava/io/PrintStream;
      11: swap
      12: invokevirtual #29                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      15: iconst_1
      16: newarray       int
      18: astore_1
      19: aload_1
      20: iconst_0
      21: iconst_4
      22: iastore
      23: aload_1
      24: invokestatic  #33                 // Method writeStalinSort:([I)V
      27: bipush        8
      29: newarray       int
      31: astore_1
      32: aload_1
      33: iconst_0
      34: bipush        6
      36: iastore
      37: aload_1
      38: iconst_1
      39: iconst_2
      40: iastore
      41: aload_1
      42: iconst_2
      43: iconst_5
      44: iastore
      45: aload_1
      46: iconst_3
      47: bipush        7
      49: iastore
      50: aload_1
      51: iconst_4
      52: iconst_3
      53: iastore
      54: aload_1
      55: iconst_5
      56: bipush        8
      58: iastore
      59: aload_1
      60: bipush        6
      62: bipush        8
      64: iastore
      65: aload_1
      66: bipush        7
      68: iconst_4
      69: iastore
      70: aload_1
      71: invokestatic  #33                 // Method writeStalinSort:([I)V
      74: bipush        9
      76: newarray       int
      78: astore_1
      79: aload_1
      80: iconst_0
      81: iconst_5
      82: iastore
      83: aload_1
      84: iconst_1
      85: iconst_3
      86: iastore
      87: aload_1
      88: iconst_2
      89: bipush        7
      91: iastore
      92: aload_1
      93: iconst_3
      94: bipush        8
      96: iastore
      97: aload_1
      98: iconst_4
      99: bipush        9
     101: iastore
     102: aload_1
     103: iconst_5
     104: iconst_5
     105: iastore
     106: aload_1
     107: bipush        6
     109: iconst_3
     110: iastore
     111: aload_1
     112: bipush        7
     114: iconst_5
     115: iastore
     116: aload_1
     117: bipush        8
     119: bipush        7
     121: iastore
     122: aload_1
     123: invokestatic  #33                 // Method writeStalinSort:([I)V
     126: return

  private static final void writeStalinSort(int[]);
    Code:
       0: new           #36                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #40                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #42                 // String Input:
       9: invokevirtual #46                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: ldc           #48                 // String ,
      15: checkcast     #50                 // class java/lang/CharSequence
      18: aconst_null
      19: aconst_null
      20: iconst_0
      21: aconst_null
      22: aconst_null
      23: bipush        62
      25: aconst_null
      26: invokestatic  #56                 // Method kotlin/collections/ArraysKt.joinToString$default:([ILjava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;
      29: invokevirtual #46                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      32: invokevirtual #60                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      35: getstatic     #23                 // Field java/lang/System.out:Ljava/io/PrintStream;
      38: swap
      39: invokevirtual #29                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      42: new           #36                 // class java/lang/StringBuilder
      45: dup
      46: invokespecial #40                 // Method java/lang/StringBuilder."<init>":()V
      49: ldc           #62                 // String StalinBy:
      51: invokevirtual #46                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      54: aload_0
      55: invokestatic  #66                 // Method kotlin/collections/ArraysKt.asSequence:([I)Lkotlin/sequences/Sequence;
      58: invokestatic  #70                 // Method stalinBy:(Lkotlin/sequences/Sequence;)Ljava/util/List;
      61: checkcast     #72                 // class java/lang/Iterable
      64: ldc           #48                 // String ,
      66: checkcast     #50                 // class java/lang/CharSequence
      69: aconst_null
      70: aconst_null
      71: iconst_0
      72: aconst_null
      73: aconst_null
      74: bipush        62
      76: aconst_null
      77: invokestatic  #77                 // Method kotlin/collections/CollectionsKt.joinToString$default:(Ljava/lang/Iterable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;
      80: invokevirtual #46                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      83: invokevirtual #60                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      86: getstatic     #23                 // Field java/lang/System.out:Ljava/io/PrintStream;
      89: swap
      90: invokevirtual #29                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      93: new           #36                 // class java/lang/StringBuilder
      96: dup
      97: invokespecial #40                 // Method java/lang/StringBuilder."<init>":()V
     100: ldc           #79                 // String StalinByDescending:
     102: invokevirtual #46                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     105: aload_0
     106: invokestatic  #66                 // Method kotlin/collections/ArraysKt.asSequence:([I)Lkotlin/sequences/Sequence;
     109: invokestatic  #82                 // Method stalinByDescending:(Lkotlin/sequences/Sequence;)Ljava/util/List;
     112: checkcast     #72                 // class java/lang/Iterable
     115: ldc           #48                 // String ,
     117: checkcast     #50                 // class java/lang/CharSequence
     120: aconst_null
     121: aconst_null
     122: iconst_0
     123: aconst_null
     124: aconst_null
     125: bipush        62
     127: aconst_null
     128: invokestatic  #77                 // Method kotlin/collections/CollectionsKt.joinToString$default:(Ljava/lang/Iterable;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Ljava/lang/CharSequence;ILjava/lang/CharSequence;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/String;
     131: invokevirtual #46                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
     134: invokevirtual #60                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
     137: getstatic     #23                 // Field java/lang/System.out:Ljava/io/PrintStream;
     140: swap
     141: invokevirtual #29                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     144: return

  public static final <T extends java.lang.Comparable<? super T>> java.util.List<T> stalinBy(kotlin.sequences.Sequence<? extends T>);
    Code:
       0: aload_0
       1: ldc           #87                 // String <this>
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: iconst_0
       8: invokestatic  #91                 // Method stalinSort:(Lkotlin/sequences/Sequence;Z)Ljava/util/List;
      11: areturn

  public static final <T extends java.lang.Comparable<? super T>> java.util.List<T> stalinByDescending(kotlin.sequences.Sequence<? extends T>);
    Code:
       0: aload_0
       1: ldc           #87                 // String <this>
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: iconst_1
       8: invokestatic  #91                 // Method stalinSort:(Lkotlin/sequences/Sequence;Z)Ljava/util/List;
      11: areturn

  private static final <T extends java.lang.Comparable<? super T>> java.util.List<T> stalinSort(kotlin.sequences.Sequence<? extends T>, boolean);
    Code:
       0: aload_0
       1: invokeinterface #101,  1          // InterfaceMethod kotlin/sequences/Sequence.iterator:()Ljava/util/Iterator;
       6: astore_2
       7: new           #103                // class java/util/ArrayList
      10: dup
      11: invokespecial #104                // Method java/util/ArrayList."<init>":()V
      14: checkcast     #106                // class java/util/List
      17: astore_3
      18: aload_2
      19: invokeinterface #112,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      24: ifeq          152
      27: aload_2
      28: invokeinterface #116,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      33: checkcast     #118                // class java/lang/Comparable
      36: astore        4
      38: aload_3
      39: aload         4
      41: invokeinterface #122,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
      46: pop
      47: aload_2
      48: invokeinterface #112,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      53: ifeq          152
      56: aload_2
      57: invokeinterface #116,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      62: checkcast     #118                // class java/lang/Comparable
      65: astore        5
      67: iload_1
      68: istore        7
      70: iload         7
      72: iconst_1
      73: if_icmpne     96
      76: aload         5
      78: aload         4
      80: invokeinterface #126,  2          // InterfaceMethod java/lang/Comparable.compareTo:(Ljava/lang/Object;)I
      85: ifgt          92
      88: iconst_1
      89: goto          129
      92: iconst_0
      93: goto          129
      96: iload         7
      98: ifne          121
     101: aload         4
     103: aload         5
     105: invokeinterface #126,  2          // InterfaceMethod java/lang/Comparable.compareTo:(Ljava/lang/Object;)I
     110: ifgt          117
     113: iconst_1
     114: goto          129
     117: iconst_0
     118: goto          129
     121: new           #128                // class kotlin/NoWhenBranchMatchedException
     124: dup
     125: invokespecial #129                // Method kotlin/NoWhenBranchMatchedException."<init>":()V
     128: athrow
     129: istore        6
     131: iload         6
     133: ifeq          47
     136: aload_3
     137: aload         5
     139: invokeinterface #122,  2          // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     144: pop
     145: aload         5
     147: astore        4
     149: goto          47
     152: aload_3
     153: areturn
}


import java.io.File

enum class Move(val value: Int)
{
    ROCK(1) {
        override fun scoreAgainst(opponentMove: Move): Int {
            return when (opponentMove) {
                ROCK -> 3
                PAPER -> 0
                SCISSORS -> 6
            }
        }

        override fun losesAgainst() = PAPER
        override fun winsAgainst() = SCISSORS
    },
    PAPER(2){
        override fun scoreAgainst(opponentMove: Move): Int {
            return when (opponentMove) {
                ROCK -> 6
                PAPER -> 3
                SCISSORS -> 0
            }
        }

        override fun losesAgainst() = SCISSORS
        override fun winsAgainst() = ROCK
    },
    SCISSORS(3){
        override fun scoreAgainst(opponentMove: Move): Int {
            return when (opponentMove) {
                ROCK -> 0
                PAPER -> 6
                SCISSORS -> 3
            }
        }
        override fun losesAgainst() = ROCK
        override fun winsAgainst() = PAPER
    };

    abstract fun scoreAgainst(opponentMove: Move) : Int
    abstract fun losesAgainst() : Move
    abstract fun winsAgainst() : Move

    companion object {
        fun fromLetter(letter: Char): Move {
            return when (letter) {
                'A' -> Move.ROCK
                'B' -> Move.PAPER
                'C' -> Move.SCISSORS
                else -> throw Exception("Unknown move $letter")
            }
        }
    }
}

fun main(args: Array<String>) {

    val FILENAME = "c:\\Users\\micro\\code\\Advent-Of-Code-2022\\Day2_02\\input.txt"

    fun scoreRound(oppLetter: Char, myLetter: Char) : Int {
        val opponentMove = Move.fromLetter(oppLetter)
        val myMove = when (myLetter) {
            'X' -> opponentMove.winsAgainst()
            'Z' -> opponentMove.losesAgainst()
            else -> opponentMove
        }
        return myMove.value + myMove.scoreAgainst(opponentMove)
    }

    var score = 0

    val file = File(FILENAME)
    file.forEachLine {
        score += scoreRound(it[0], it[2])
    }

    println("My total score is $score")
}

Compiled from "Main.kt"
public final class MainKt {
  public static final void main(java.lang.String[]);
    Code:
       0: aload_0
       1: ldc           #9                  // String args
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: ldc           #17                 // String c:\\Users\\micro\\code\\Advent-Of-Code-2022\\Day2_02\\input.txt
       8: astore_1
       9: new           #19                 // class kotlin/jvm/internal/Ref$IntRef
      12: dup
      13: invokespecial #23                 // Method kotlin/jvm/internal/Ref$IntRef."<init>":()V
      16: astore_2
      17: new           #25                 // class java/io/File
      20: dup
      21: aload_1
      22: invokespecial #28                 // Method java/io/File."<init>":(Ljava/lang/String;)V
      25: astore_3
      26: aload_3
      27: aconst_null
      28: aload_2
      29: invokedynamic #48,  0             // InvokeDynamic #0:invoke:(Lkotlin/jvm/internal/Ref$IntRef;)Lkotlin/jvm/functions/Function1;
      34: iconst_1
      35: aconst_null
      36: invokestatic  #54                 // Method kotlin/io/FilesKt.forEachLine$default:(Ljava/io/File;Ljava/nio/charset/Charset;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
      39: new           #56                 // class java/lang/StringBuilder
      42: dup
      43: invokespecial #57                 // Method java/lang/StringBuilder."<init>":()V
      46: ldc           #59                 // String My total score is
      48: invokevirtual #63                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      51: aload_2
      52: getfield      #67                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
      55: invokevirtual #70                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      58: invokevirtual #74                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      61: getstatic     #80                 // Field java/lang/System.out:Ljava/io/PrintStream;
      64: swap
      65: invokevirtual #86                 // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
      68: return

  private static final int main$scoreRound(char, char);
    Code:
       0: getstatic     #101                // Field Move.Companion:LMove$Companion;
       3: iload_0
       4: invokevirtual #107                // Method Move$Companion.fromLetter:(C)LMove;
       7: astore_2
       8: iload_1
       9: tableswitch   { // 88 to 90
                    88: 36
                    89: 50
                    90: 43
               default: 50
          }
      36: aload_2
      37: invokevirtual #111                // Method Move.winsAgainst:()LMove;
      40: goto          51
      43: aload_2
      44: invokevirtual #114                // Method Move.losesAgainst:()LMove;
      47: goto          51
      50: aload_2
      51: astore_3
      52: aload_3
      53: invokevirtual #118                // Method Move.getValue:()I
      56: aload_3
      57: aload_2
      58: invokevirtual #122                // Method Move.scoreAgainst:(LMove;)I
      61: iadd
      62: ireturn

  private static final kotlin.Unit main$lambda$0(kotlin.jvm.internal.Ref$IntRef, java.lang.String);
    Code:
       0: aload_1
       1: ldc           #130                // String it
       3: invokestatic  #15                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_0
       7: aload_0
       8: getfield      #67                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
      11: aload_1
      12: iconst_0
      13: invokevirtual #136                // Method java/lang/String.charAt:(I)C
      16: aload_1
      17: iconst_2
      18: invokevirtual #136                // Method java/lang/String.charAt:(I)C
      21: invokestatic  #138                // Method main$scoreRound:(CC)I
      24: iadd
      25: putfield      #67                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
      28: getstatic     #144                // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
      31: areturn
}


// https://en.wikipedia.org/wiki/Dinic%27s_algorithm in O(V^2 * E)
object MaxFlowDinic {

    data class Edge(val t: Int, val rev: Int, val cap: Int, var f: Int = 0)

    fun addEdge(graph: Array<ArrayList<Edge>>, s: Int, t: Int, cap: Int) {
        graph[s].add(Edge(t, graph[t].size, cap))
        graph[t].add(Edge(s, graph[s].size - 1, 0))
    }

    fun dinicBfs(graph: Array<out List<Edge>>, src: Int, dest: Int, dist: IntArray): Boolean {
        dist.fill(-1)
        dist[src] = 0
        val Q = IntArray(graph.size)
        var sizeQ = 0
        Q[sizeQ++] = src
        var i = 0
        while (i < sizeQ) {
            val u = Q[i++]
            for (e in graph[u]) {
                if (dist[e.t] < 0 && e.f < e.cap) {
                    dist[e.t] = dist[u] + 1
                    Q[sizeQ++] = e.t
                }
            }
        }
        return dist[dest] >= 0
    }

    fun dinicDfs(graph: Array<out List<Edge>>, ptr: IntArray, dist: IntArray, dest: Int, u: Int, f: Int): Int {
        if (u == dest)
            return f
        while (ptr[u] < graph[u].size) {
            val e = graph[u][ptr[u]]
            if (dist[e.t] == dist[u] + 1 && e.f < e.cap) {
                val df = dinicDfs(graph, ptr, dist, dest, e.t, Math.min(f, e.cap - e.f))
                if (df > 0) {
                    e.f += df
                    graph[e.t][e.rev].f -= df
                    return df
                }
            }
            ++ptr[u]
        }
        return 0
    }

    fun maxFlow(graph: Array<out List<Edge>>, src: Int, dest: Int): Int {
        var flow = 0
        val dist = IntArray(graph.size)
        while (dinicBfs(graph, src, dest, dist)) {
            val ptr = IntArray(graph.size)
            while (true) {
                val df = dinicDfs(graph, ptr, dist, dest, src, Int.MAX_VALUE)
                if (df == 0)
                    break
                flow += df
            }
        }
        return flow
    }

    // Usage example
    @JvmStatic
    fun main(args: Array<String>) {
        val graph = (1..3).map { arrayListOf<Edge>() }.toTypedArray()
        addEdge(graph, 0, 1, 3)
        addEdge(graph, 0, 2, 2)
        addEdge(graph, 1, 2, 2)
        val maxFlow = maxFlow(graph, 0, 2)
        println(4 == maxFlow)
    }
}

Compiled from "MaxFlowDinic.kt"
public final class MaxFlowDinic$Edge {
  private final int t;

  private final int rev;

  private final int cap;

  private int f;

  public MaxFlowDinic$Edge(int, int, int, int);
    Code:
       0: aload_0
       1: invokespecial #9                  // Method java/lang/Object."<init>":()V
       4: aload_0
       5: iload_1
       6: putfield      #13                 // Field t:I
       9: aload_0
      10: iload_2
      11: putfield      #16                 // Field rev:I
      14: aload_0
      15: iload_3
      16: putfield      #19                 // Field cap:I
      19: aload_0
      20: iload         4
      22: putfield      #22                 // Field f:I
      25: return

  public MaxFlowDinic$Edge(int, int, int, int, int, kotlin.jvm.internal.DefaultConstructorMarker);
    Code:
       0: iload         5
       2: bipush        8
       4: iand
       5: ifeq          11
       8: iconst_0
       9: istore        4
      11: aload_0
      12: iload_1
      13: iload_2
      14: iload_3
      15: iload         4
      17: invokespecial #27                 // Method "<init>":(IIII)V
      20: return

  public final int getT();
    Code:
       0: aload_0
       1: getfield      #13                 // Field t:I
       4: ireturn

  public final int getRev();
    Code:
       0: aload_0
       1: getfield      #16                 // Field rev:I
       4: ireturn

  public final int getCap();
    Code:
       0: aload_0
       1: getfield      #19                 // Field cap:I
       4: ireturn

  public final int getF();
    Code:
       0: aload_0
       1: getfield      #22                 // Field f:I
       4: ireturn

  public final void setF(int);
    Code:
       0: aload_0
       1: iload_1
       2: putfield      #22                 // Field f:I
       5: return

  public final int component1();
    Code:
       0: aload_0
       1: getfield      #13                 // Field t:I
       4: ireturn

  public final int component2();
    Code:
       0: aload_0
       1: getfield      #16                 // Field rev:I
       4: ireturn

  public final int component3();
    Code:
       0: aload_0
       1: getfield      #19                 // Field cap:I
       4: ireturn

  public final int component4();
    Code:
       0: aload_0
       1: getfield      #22                 // Field f:I
       4: ireturn

  public final MaxFlowDinic$Edge copy(int, int, int, int);
    Code:
       0: new           #2                  // class MaxFlowDinic$Edge
       3: dup
       4: iload_1
       5: iload_2
       6: iload_3
       7: iload         4
       9: invokespecial #27                 // Method "<init>":(IIII)V
      12: areturn

  public static MaxFlowDinic$Edge copy$default(MaxFlowDinic$Edge, int, int, int, int, int, java.lang.Object);
    Code:
       0: iload         5
       2: iconst_1
       3: iand
       4: ifeq          12
       7: aload_0
       8: getfield      #13                 // Field t:I
      11: istore_1
      12: iload         5
      14: iconst_2
      15: iand
      16: ifeq          24
      19: aload_0
      20: getfield      #16                 // Field rev:I
      23: istore_2
      24: iload         5
      26: iconst_4
      27: iand
      28: ifeq          36
      31: aload_0
      32: getfield      #19                 // Field cap:I
      35: istore_3
      36: iload         5
      38: bipush        8
      40: iand
      41: ifeq          50
      44: aload_0
      45: getfield      #22                 // Field f:I
      48: istore        4
      50: aload_0
      51: iload_1
      52: iload_2
      53: iload_3
      54: iload         4
      56: invokevirtual #46                 // Method copy:(IIII)LMaxFlowDinic$Edge;
      59: areturn

  public java.lang.String toString();
    Code:
       0: new           #50                 // class java/lang/StringBuilder
       3: dup
       4: invokespecial #51                 // Method java/lang/StringBuilder."<init>":()V
       7: ldc           #53                 // String Edge(t=
       9: invokevirtual #57                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      12: aload_0
      13: getfield      #13                 // Field t:I
      16: invokevirtual #60                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      19: ldc           #62                 // String , rev=
      21: invokevirtual #57                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      24: aload_0
      25: getfield      #16                 // Field rev:I
      28: invokevirtual #60                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      31: ldc           #64                 // String , cap=
      33: invokevirtual #57                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      36: aload_0
      37: getfield      #19                 // Field cap:I
      40: invokevirtual #60                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      43: ldc           #66                 // String , f=
      45: invokevirtual #57                 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
      48: aload_0
      49: getfield      #22                 // Field f:I
      52: invokevirtual #60                 // Method java/lang/StringBuilder.append:(I)Ljava/lang/StringBuilder;
      55: bipush        41
      57: invokevirtual #69                 // Method java/lang/StringBuilder.append:(C)Ljava/lang/StringBuilder;
      60: invokevirtual #71                 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
      63: areturn

  public int hashCode();
    Code:
       0: aload_0
       1: getfield      #13                 // Field t:I
       4: invokestatic  #77                 // Method java/lang/Integer.hashCode:(I)I
       7: istore_1
       8: iload_1
       9: bipush        31
      11: imul
      12: aload_0
      13: getfield      #16                 // Field rev:I
      16: invokestatic  #77                 // Method java/lang/Integer.hashCode:(I)I
      19: iadd
      20: istore_1
      21: iload_1
      22: bipush        31
      24: imul
      25: aload_0
      26: getfield      #19                 // Field cap:I
      29: invokestatic  #77                 // Method java/lang/Integer.hashCode:(I)I
      32: iadd
      33: istore_1
      34: iload_1
      35: bipush        31
      37: imul
      38: aload_0
      39: getfield      #22                 // Field f:I
      42: invokestatic  #77                 // Method java/lang/Integer.hashCode:(I)I
      45: iadd
      46: istore_1
      47: iload_1
      48: ireturn

  public boolean equals(java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: if_acmpne     7
       5: iconst_1
       6: ireturn
       7: aload_1
       8: instanceof    #2                  // class MaxFlowDinic$Edge
      11: ifne          16
      14: iconst_0
      15: ireturn
      16: aload_1
      17: checkcast     #2                  // class MaxFlowDinic$Edge
      20: astore_2
      21: aload_0
      22: getfield      #13                 // Field t:I
      25: aload_2
      26: getfield      #13                 // Field t:I
      29: if_icmpeq     34
      32: iconst_0
      33: ireturn
      34: aload_0
      35: getfield      #16                 // Field rev:I
      38: aload_2
      39: getfield      #16                 // Field rev:I
      42: if_icmpeq     47
      45: iconst_0
      46: ireturn
      47: aload_0
      48: getfield      #19                 // Field cap:I
      51: aload_2
      52: getfield      #19                 // Field cap:I
      55: if_icmpeq     60
      58: iconst_0
      59: ireturn
      60: aload_0
      61: getfield      #22                 // Field f:I
      64: aload_2
      65: getfield      #22                 // Field f:I
      68: if_icmpeq     73
      71: iconst_0
      72: ireturn
      73: iconst_1
      74: ireturn
}

Compiled from "MaxFlowDinic.kt"
public final class MaxFlowDinic {
  public static final MaxFlowDinic INSTANCE;

  private MaxFlowDinic();
    Code:
       0: aload_0
       1: invokespecial #8                  // Method java/lang/Object."<init>":()V
       4: return

  public final void addEdge(java.util.ArrayList<MaxFlowDinic$Edge>[], int, int, int);
    Code:
       0: aload_1
       1: ldc           #16                 // String graph
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_1
       7: iload_2
       8: aaload
       9: new           #24                 // class MaxFlowDinic$Edge
      12: dup
      13: iload_3
      14: aload_1
      15: iload_3
      16: aaload
      17: invokevirtual #30                 // Method java/util/ArrayList.size:()I
      20: iload         4
      22: iconst_0
      23: bipush        8
      25: aconst_null
      26: invokespecial #33                 // Method MaxFlowDinic$Edge."<init>":(IIIIILkotlin/jvm/internal/DefaultConstructorMarker;)V
      29: invokevirtual #37                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
      32: pop
      33: aload_1
      34: iload_3
      35: aaload
      36: new           #24                 // class MaxFlowDinic$Edge
      39: dup
      40: iload_2
      41: aload_1
      42: iload_2
      43: aaload
      44: invokevirtual #30                 // Method java/util/ArrayList.size:()I
      47: iconst_1
      48: isub
      49: iconst_0
      50: iconst_0
      51: bipush        8
      53: aconst_null
      54: invokespecial #33                 // Method MaxFlowDinic$Edge."<init>":(IIIIILkotlin/jvm/internal/DefaultConstructorMarker;)V
      57: invokevirtual #37                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
      60: pop
      61: return

  public final boolean dinicBfs(java.util.List<MaxFlowDinic$Edge>[], int, int, int[]);
    Code:
       0: aload_1
       1: ldc           #16                 // String graph
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload         4
       8: ldc           #47                 // String dist
      10: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      13: aload         4
      15: iconst_m1
      16: iconst_0
      17: iconst_0
      18: bipush        6
      20: aconst_null
      21: invokestatic  #53                 // Method kotlin/collections/ArraysKt.fill$default:([IIIIILjava/lang/Object;)V
      24: aload         4
      26: iload_2
      27: iconst_0
      28: iastore
      29: aload_1
      30: arraylength
      31: newarray       int
      33: astore        5
      35: iconst_0
      36: istore        6
      38: aload         5
      40: iload         6
      42: iinc          6, 1
      45: iload_2
      46: iastore
      47: iconst_0
      48: istore        7
      50: iload         7
      52: iload         6
      54: if_icmpge     155
      57: aload         5
      59: iload         7
      61: iinc          7, 1
      64: iaload
      65: istore        8
      67: aload_1
      68: iload         8
      70: aaload
      71: invokeinterface #59,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
      76: astore        9
      78: aload         9
      80: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      85: ifeq          50
      88: aload         9
      90: invokeinterface #69,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      95: checkcast     #24                 // class MaxFlowDinic$Edge
      98: astore        10
     100: aload         4
     102: aload         10
     104: invokevirtual #72                 // Method MaxFlowDinic$Edge.getT:()I
     107: iaload
     108: ifge          78
     111: aload         10
     113: invokevirtual #75                 // Method MaxFlowDinic$Edge.getF:()I
     116: aload         10
     118: invokevirtual #78                 // Method MaxFlowDinic$Edge.getCap:()I
     121: if_icmpge     78
     124: aload         4
     126: aload         10
     128: invokevirtual #72                 // Method MaxFlowDinic$Edge.getT:()I
     131: aload         4
     133: iload         8
     135: iaload
     136: iconst_1
     137: iadd
     138: iastore
     139: aload         5
     141: iload         6
     143: iinc          6, 1
     146: aload         10
     148: invokevirtual #72                 // Method MaxFlowDinic$Edge.getT:()I
     151: iastore
     152: goto          78
     155: aload         4
     157: iload_3
     158: iaload
     159: iflt          166
     162: iconst_1
     163: goto          167
     166: iconst_0
     167: ireturn

  public final int dinicDfs(java.util.List<MaxFlowDinic$Edge>[], int[], int[], int, int, int);
    Code:
       0: aload_1
       1: ldc           #16                 // String graph
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: aload_2
       7: ldc           #94                 // String ptr
       9: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      12: aload_3
      13: ldc           #47                 // String dist
      15: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
      18: iload         5
      20: iload         4
      22: if_icmpne     28
      25: iload         6
      27: ireturn
      28: aload_2
      29: iload         5
      31: iaload
      32: aload_1
      33: iload         5
      35: aaload
      36: invokeinterface #95,  1           // InterfaceMethod java/util/List.size:()I
      41: if_icmpge     197
      44: aload_1
      45: iload         5
      47: aaload
      48: aload_2
      49: iload         5
      51: iaload
      52: invokeinterface #99,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      57: checkcast     #24                 // class MaxFlowDinic$Edge
      60: astore        7
      62: aload_3
      63: aload         7
      65: invokevirtual #72                 // Method MaxFlowDinic$Edge.getT:()I
      68: iaload
      69: aload_3
      70: iload         5
      72: iaload
      73: iconst_1
      74: iadd
      75: if_icmpne     179
      78: aload         7
      80: invokevirtual #75                 // Method MaxFlowDinic$Edge.getF:()I
      83: aload         7
      85: invokevirtual #78                 // Method MaxFlowDinic$Edge.getCap:()I
      88: if_icmpge     179
      91: aload_0
      92: aload_1
      93: aload_2
      94: aload_3
      95: iload         4
      97: aload         7
      99: invokevirtual #72                 // Method MaxFlowDinic$Edge.getT:()I
     102: iload         6
     104: aload         7
     106: invokevirtual #78                 // Method MaxFlowDinic$Edge.getCap:()I
     109: aload         7
     111: invokevirtual #75                 // Method MaxFlowDinic$Edge.getF:()I
     114: isub
     115: invokestatic  #105                // Method java/lang/Math.min:(II)I
     118: invokevirtual #107                // Method dinicDfs:([Ljava/util/List;[I[IIII)I
     121: istore        8
     123: iload         8
     125: ifle          179
     128: aload         7
     130: aload         7
     132: invokevirtual #75                 // Method MaxFlowDinic$Edge.getF:()I
     135: iload         8
     137: iadd
     138: invokevirtual #111                // Method MaxFlowDinic$Edge.setF:(I)V
     141: aload_1
     142: aload         7
     144: invokevirtual #72                 // Method MaxFlowDinic$Edge.getT:()I
     147: aaload
     148: aload         7
     150: invokevirtual #114                // Method MaxFlowDinic$Edge.getRev:()I
     153: invokeinterface #99,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     158: checkcast     #24                 // class MaxFlowDinic$Edge
     161: astore        9
     163: aload         9
     165: aload         9
     167: invokevirtual #75                 // Method MaxFlowDinic$Edge.getF:()I
     170: iload         8
     172: isub
     173: invokevirtual #111                // Method MaxFlowDinic$Edge.setF:(I)V
     176: iload         8
     178: ireturn
     179: aload_2
     180: iload         5
     182: aload_2
     183: iload         5
     185: iaload
     186: iconst_1
     187: iadd
     188: iastore
     189: aload_2
     190: iload         5
     192: iaload
     193: pop
     194: goto          28
     197: iconst_0
     198: ireturn

  public final int maxFlow(java.util.List<MaxFlowDinic$Edge>[], int, int);
    Code:
       0: aload_1
       1: ldc           #16                 // String graph
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: iconst_0
       7: istore        4
       9: aload_1
      10: arraylength
      11: newarray       int
      13: astore        5
      15: aload_0
      16: aload_1
      17: iload_2
      18: iload_3
      19: aload         5
      21: invokevirtual #121                // Method dinicBfs:([Ljava/util/List;II[I)Z
      24: ifeq          67
      27: aload_1
      28: arraylength
      29: newarray       int
      31: astore        6
      33: nop
      34: aload_0
      35: aload_1
      36: aload         6
      38: aload         5
      40: iload_3
      41: iload_2
      42: ldc           #122                // int 2147483647
      44: invokevirtual #107                // Method dinicDfs:([Ljava/util/List;[I[IIII)I
      47: istore        7
      49: iload         7
      51: ifne          57
      54: goto          15
      57: iload         4
      59: iload         7
      61: iadd
      62: istore        4
      64: goto          33
      67: iload         4
      69: ireturn

  public static final void main(java.lang.String[]);
    Code:
       0: aload_0
       1: ldc           #128                // String args
       3: invokestatic  #22                 // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #130                // class kotlin/ranges/IntRange
       9: dup
      10: iconst_1
      11: iconst_3
      12: invokespecial #133                // Method kotlin/ranges/IntRange."<init>":(II)V
      15: checkcast     #135                // class java/lang/Iterable
      18: astore_2
      19: iconst_0
      20: istore_3
      21: aload_2
      22: astore        4
      24: new           #26                 // class java/util/ArrayList
      27: dup
      28: aload_2
      29: bipush        10
      31: invokestatic  #141                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      34: invokespecial #143                // Method java/util/ArrayList."<init>":(I)V
      37: checkcast     #145                // class java/util/Collection
      40: astore        5
      42: iconst_0
      43: istore        6
      45: aload         4
      47: invokeinterface #146,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      52: astore        7
      54: aload         7
      56: invokeinterface #65,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      61: ifeq          105
      64: aload         7
      66: checkcast     #148                // class kotlin/collections/IntIterator
      69: invokevirtual #151                // Method kotlin/collections/IntIterator.nextInt:()I
      72: istore        8
      74: aload         5
      76: iload         8
      78: istore        9
      80: astore        11
      82: iconst_0
      83: istore        10
      85: new           #26                 // class java/util/ArrayList
      88: dup
      89: invokespecial #152                // Method java/util/ArrayList."<init>":()V
      92: nop
      93: aload         11
      95: swap
      96: invokeinterface #153,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     101: pop
     102: goto          54
     105: aload         5
     107: checkcast     #55                 // class java/util/List
     110: nop
     111: checkcast     #145                // class java/util/Collection
     114: astore_2
     115: nop
     116: iconst_0
     117: istore_3
     118: aload_2
     119: astore        4
     121: aload         4
     123: iconst_0
     124: anewarray     #26                 // class java/util/ArrayList
     127: invokeinterface #157,  2          // InterfaceMethod java/util/Collection.toArray:([Ljava/lang/Object;)[Ljava/lang/Object;
     132: checkcast     #158                // class "[Ljava/util/ArrayList;"
     135: astore_1
     136: getstatic     #161                // Field INSTANCE:LMaxFlowDinic;
     139: aload_1
     140: iconst_0
     141: iconst_1
     142: iconst_3
     143: invokevirtual #163                // Method addEdge:([Ljava/util/ArrayList;III)V
     146: getstatic     #161                // Field INSTANCE:LMaxFlowDinic;
     149: aload_1
     150: iconst_0
     151: iconst_2
     152: iconst_2
     153: invokevirtual #163                // Method addEdge:([Ljava/util/ArrayList;III)V
     156: getstatic     #161                // Field INSTANCE:LMaxFlowDinic;
     159: aload_1
     160: iconst_1
     161: iconst_2
     162: iconst_2
     163: invokevirtual #163                // Method addEdge:([Ljava/util/ArrayList;III)V
     166: getstatic     #161                // Field INSTANCE:LMaxFlowDinic;
     169: aload_1
     170: checkcast     #164                // class "[Ljava/util/List;"
     173: iconst_0
     174: iconst_2
     175: invokevirtual #166                // Method maxFlow:([Ljava/util/List;II)I
     178: istore_2
     179: iconst_4
     180: iload_2
     181: if_icmpne     188
     184: iconst_1
     185: goto          189
     188: iconst_0
     189: istore_3
     190: getstatic     #172                // Field java/lang/System.out:Ljava/io/PrintStream;
     193: iload_3
     194: invokevirtual #178                // Method java/io/PrintStream.println:(Z)V
     197: return

  static {};
    Code:
       0: new           #2                  // class MaxFlowDinic
       3: dup
       4: invokespecial #195                // Method "<init>":()V
       7: putstatic     #161                // Field INSTANCE:LMaxFlowDinic;
      10: return
}