package workshops.moscow_prefinals2020.day4

fun main() {
	val (n, m) = readInts()
	val g = MutableList(n) { DoubleArray(n) }
	repeat(m) {
		val (uIn, vIn, resistance) = readInts()
		for ((u, v) in listOf(uIn, vIn).map { it - 1 }.withReversed()) {
			g[u][v] += 1.0 / resistance
			g[u][u] -= 1.0 / resistance
		}
	}
	val potential = List(n) { kirchhoff(g, 0, it) }
	val current = List(n) { v -> g.indices.sumByDouble { potential[v][it] * g[0][it] } }
	val ans = List(n) { v -> DoubleArray(v) { u ->
		if (u == 0) return@DoubleArray 1 / current[v]
		fun newPotential(w: Int) = potential[u][w] - potential[v][w] * current[u] / current[v]
		val (npu, npv) = listOf(u, v).map(::newPotential)
		1 / g.indices.sumByDouble {	g[u][it] * (newPotential(it) - npu) / (npv - npu) }
	}}
	println(List(readInt()) {
		val (u, v) = readInts().map { it - 1 }.sorted()
		ans[v][u]
	}.joinToString("\n"))
}

private fun kirchhoff(g: List<DoubleArray>, @Suppress("SameParameterValue") u: Int, v: Int): DoubleArray {
	val gClone = g.map { it.clone() }
	listOf(u, v).forEach { gClone[it].fill(0.0); gClone[it][it] = 1.0 }
	val h = DoubleArray(gClone.size).also { it[v] = 1.0 }
	return gauss(gClone, h)
}

private fun gauss(a: List<DoubleArray>, b: DoubleArray): DoubleArray {
	val m = a.size
	val n = a[0].size
	val pos = IntArray(m)
	for (i in 0 until m) {
		val ai = a[i]
		val s = (0 until n).maxByOrNull { ai[it].abs() }!!
		pos[i] = s
		for (k in 0 until m) if (k != i) {
			val ak = a[k]
			val c = -ak[s] / ai[s]
			for (j in 0 until n) ak[j] += c * ai[j]
			b[k] += c * b[i]
		}
	}
	val ans = DoubleArray(n)
	for (i in 0 until m) ans[pos[i]] = b[i] / a[i][pos[i]]
	return ans
}

private fun <T> Iterable<T>.withReversed() = listOf(toList(), reversed())
private fun Double.abs() = kotlin.math.abs(this)
private fun readLn() = readLine()!!
private fun readInt() = readLn().toInt()
private fun readStrings() = readLn().split(" ")
private fun readInts() = readStrings().map { it.toInt() }

Compiled from "k.kt"
public final class workshops.moscow_prefinals2020.day4.KKt {
  public static final void main();
    Code:
       0: invokestatic  #10                 // Method readInts:()Ljava/util/List;
       3: astore_0
       4: aload_0
       5: iconst_0
       6: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      11: checkcast     #18                 // class java/lang/Number
      14: invokevirtual #22                 // Method java/lang/Number.intValue:()I
      17: istore_1
      18: aload_0
      19: iconst_1
      20: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      25: checkcast     #18                 // class java/lang/Number
      28: invokevirtual #22                 // Method java/lang/Number.intValue:()I
      31: istore_2
      32: new           #24                 // class java/util/ArrayList
      35: dup
      36: iload_1
      37: invokespecial #28                 // Method java/util/ArrayList."<init>":(I)V
      40: astore        4
      42: iconst_0
      43: istore        5
      45: iload         5
      47: iload_1
      48: if_icmpge     82
      51: iload         5
      53: istore        6
      55: aload         4
      57: iload         6
      59: istore        7
      61: astore        46
      63: iconst_0
      64: istore        8
      66: iload_1
      67: newarray       double
      69: aload         46
      71: swap
      72: invokevirtual #32                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
      75: pop
      76: iinc          5, 1
      79: goto          45
      82: aload         4
      84: checkcast     #12                 // class java/util/List
      87: astore_3
      88: iconst_0
      89: istore        4
      91: iload         4
      93: iload_2
      94: if_icmpge     425
      97: iload         4
      99: istore        5
     101: iconst_0
     102: istore        6
     104: invokestatic  #10                 // Method readInts:()Ljava/util/List;
     107: astore        7
     109: aload         7
     111: iconst_0
     112: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     117: checkcast     #18                 // class java/lang/Number
     120: invokevirtual #22                 // Method java/lang/Number.intValue:()I
     123: istore        8
     125: aload         7
     127: iconst_1
     128: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     133: checkcast     #18                 // class java/lang/Number
     136: invokevirtual #22                 // Method java/lang/Number.intValue:()I
     139: istore        9
     141: aload         7
     143: iconst_2
     144: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     149: checkcast     #18                 // class java/lang/Number
     152: invokevirtual #22                 // Method java/lang/Number.intValue:()I
     155: istore        10
     157: iconst_2
     158: anewarray     #34                 // class java/lang/Integer
     161: astore        11
     163: aload         11
     165: iconst_0
     166: iload         8
     168: invokestatic  #38                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     171: aastore
     172: aload         11
     174: iconst_1
     175: iload         9
     177: invokestatic  #38                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     180: aastore
     181: aload         11
     183: invokestatic  #44                 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
     186: checkcast     #46                 // class java/lang/Iterable
     189: astore        11
     191: iconst_0
     192: istore        12
     194: aload         11
     196: astore        13
     198: new           #24                 // class java/util/ArrayList
     201: dup
     202: aload         11
     204: bipush        10
     206: invokestatic  #50                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     209: invokespecial #28                 // Method java/util/ArrayList."<init>":(I)V
     212: checkcast     #52                 // class java/util/Collection
     215: astore        14
     217: iconst_0
     218: istore        15
     220: aload         13
     222: invokeinterface #56,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     227: astore        16
     229: aload         16
     231: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     236: ifeq          284
     239: aload         16
     241: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     246: astore        17
     248: aload         14
     250: aload         17
     252: checkcast     #18                 // class java/lang/Number
     255: invokevirtual #22                 // Method java/lang/Number.intValue:()I
     258: istore        18
     260: astore        19
     262: iconst_0
     263: istore        20
     265: iload         18
     267: iconst_1
     268: isub
     269: invokestatic  #38                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     272: aload         19
     274: swap
     275: invokeinterface #67,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     280: pop
     281: goto          229
     284: aload         14
     286: checkcast     #12                 // class java/util/List
     289: nop
     290: checkcast     #46                 // class java/lang/Iterable
     293: invokestatic  #71                 // Method withReversed:(Ljava/lang/Iterable;)Ljava/util/List;
     296: invokeinterface #72,  1           // InterfaceMethod java/util/List.iterator:()Ljava/util/Iterator;
     301: astore        21
     303: aload         21
     305: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     310: ifeq          418
     313: aload         21
     315: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     320: checkcast     #12                 // class java/util/List
     323: astore        11
     325: aload         11
     327: iconst_0
     328: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     333: checkcast     #18                 // class java/lang/Number
     336: invokevirtual #22                 // Method java/lang/Number.intValue:()I
     339: istore        12
     341: aload         11
     343: iconst_1
     344: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     349: checkcast     #18                 // class java/lang/Number
     352: invokevirtual #22                 // Method java/lang/Number.intValue:()I
     355: istore        13
     357: aload_3
     358: iload         12
     360: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     365: checkcast     #74                 // class "[D"
     368: astore        14
     370: aload         14
     372: iload         13
     374: aload         14
     376: iload         13
     378: daload
     379: dconst_1
     380: iload         10
     382: i2d
     383: ddiv
     384: dadd
     385: dastore
     386: aload_3
     387: iload         12
     389: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     394: checkcast     #74                 // class "[D"
     397: astore        14
     399: aload         14
     401: iload         12
     403: aload         14
     405: iload         12
     407: daload
     408: dconst_1
     409: iload         10
     411: i2d
     412: ddiv
     413: dsub
     414: dastore
     415: goto          303
     418: nop
     419: iinc          4, 1
     422: goto          91
     425: new           #24                 // class java/util/ArrayList
     428: dup
     429: iload_1
     430: invokespecial #28                 // Method java/util/ArrayList."<init>":(I)V
     433: astore        5
     435: iconst_0
     436: istore        6
     438: iload         6
     440: iload_1
     441: if_icmpge     479
     444: iload         6
     446: istore        7
     448: aload         5
     450: iload         7
     452: istore        8
     454: astore        46
     456: iconst_0
     457: istore        9
     459: aload_3
     460: iconst_0
     461: iload         8
     463: invokestatic  #78                 // Method kirchhoff:(Ljava/util/List;II)[D
     466: aload         46
     468: swap
     469: invokevirtual #32                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     472: pop
     473: iinc          6, 1
     476: goto          438
     479: aload         5
     481: checkcast     #12                 // class java/util/List
     484: astore        4
     486: new           #24                 // class java/util/ArrayList
     489: dup
     490: iload_1
     491: invokespecial #28                 // Method java/util/ArrayList."<init>":(I)V
     494: astore        6
     496: iconst_0
     497: istore        7
     499: iload         7
     501: iload_1
     502: if_icmpge     638
     505: iload         7
     507: istore        8
     509: aload         6
     511: iload         8
     513: istore        9
     515: astore        46
     517: iconst_0
     518: istore        10
     520: aload_3
     521: checkcast     #52                 // class java/util/Collection
     524: invokestatic  #82                 // Method kotlin/collections/CollectionsKt.getIndices:(Ljava/util/Collection;)Lkotlin/ranges/IntRange;
     527: checkcast     #46                 // class java/lang/Iterable
     530: astore        11
     532: iconst_0
     533: istore        12
     535: dconst_0
     536: dstore        13
     538: aload         11
     540: invokeinterface #56,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     545: astore        15
     547: aload         15
     549: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     554: ifeq          619
     557: aload         15
     559: checkcast     #84                 // class kotlin/collections/IntIterator
     562: invokevirtual #87                 // Method kotlin/collections/IntIterator.nextInt:()I
     565: istore        16
     567: dload         13
     569: iload         16
     571: istore        17
     573: dstore        18
     575: iconst_0
     576: istore        20
     578: aload         4
     580: iload         9
     582: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     587: checkcast     #74                 // class "[D"
     590: iload         17
     592: daload
     593: aload_3
     594: iconst_0
     595: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     600: checkcast     #74                 // class "[D"
     603: iload         17
     605: daload
     606: dmul
     607: dstore        21
     609: dload         18
     611: dload         21
     613: dadd
     614: dstore        13
     616: goto          547
     619: dload         13
     621: nop
     622: invokestatic  #92                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     625: aload         46
     627: swap
     628: invokevirtual #32                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     631: pop
     632: iinc          7, 1
     635: goto          499
     638: aload         6
     640: checkcast     #12                 // class java/util/List
     643: astore        5
     645: new           #24                 // class java/util/ArrayList
     648: dup
     649: iload_1
     650: invokespecial #28                 // Method java/util/ArrayList."<init>":(I)V
     653: astore        7
     655: iconst_0
     656: istore        8
     658: iload         8
     660: iload_1
     661: if_icmpge     1062
     664: iload         8
     666: istore        9
     668: aload         7
     670: iload         9
     672: istore        10
     674: astore        46
     676: iconst_0
     677: istore        11
     679: iconst_0
     680: istore        12
     682: iload         10
     684: newarray       double
     686: astore        13
     688: iload         12
     690: iload         10
     692: if_icmpge     1046
     695: iload         12
     697: istore        14
     699: aload         13
     701: iload         14
     703: istore        15
     705: astore        16
     707: iload         14
     709: ifne          735
     712: iconst_1
     713: i2d
     714: aload         5
     716: iload         10
     718: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     723: checkcast     #18                 // class java/lang/Number
     726: invokevirtual #96                 // Method java/lang/Number.doubleValue:()D
     729: ddiv
     730: dstore        17
     732: goto          1033
     735: iconst_2
     736: anewarray     #34                 // class java/lang/Integer
     739: astore        19
     741: aload         19
     743: iconst_0
     744: iload         14
     746: invokestatic  #38                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     749: aastore
     750: aload         19
     752: iconst_1
     753: iload         10
     755: invokestatic  #38                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     758: aastore
     759: aload         19
     761: invokestatic  #44                 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
     764: checkcast     #46                 // class java/lang/Iterable
     767: astore        19
     769: iconst_0
     770: istore        20
     772: aload         19
     774: astore        21
     776: new           #24                 // class java/util/ArrayList
     779: dup
     780: aload         19
     782: bipush        10
     784: invokestatic  #50                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     787: invokespecial #28                 // Method java/util/ArrayList."<init>":(I)V
     790: checkcast     #52                 // class java/util/Collection
     793: astore        23
     795: iconst_0
     796: istore        24
     798: aload         21
     800: invokeinterface #56,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     805: astore        25
     807: aload         25
     809: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     814: ifeq          871
     817: aload         25
     819: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     824: astore        26
     826: aload         23
     828: aload         26
     830: checkcast     #18                 // class java/lang/Number
     833: invokevirtual #22                 // Method java/lang/Number.intValue:()I
     836: istore        27
     838: astore        28
     840: iconst_0
     841: istore        29
     843: aload         4
     845: iload         14
     847: iload         10
     849: aload         5
     851: iload         27
     853: invokestatic  #100                // Method main$lambda$7$newPotential:(Ljava/util/List;IILjava/util/List;I)D
     856: invokestatic  #92                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     859: aload         28
     861: swap
     862: invokeinterface #67,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     867: pop
     868: goto          807
     871: aload         23
     873: checkcast     #12                 // class java/util/List
     876: nop
     877: astore        30
     879: aload         30
     881: iconst_0
     882: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     887: checkcast     #18                 // class java/lang/Number
     890: invokevirtual #96                 // Method java/lang/Number.doubleValue:()D
     893: dstore        31
     895: aload         30
     897: iconst_1
     898: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     903: checkcast     #18                 // class java/lang/Number
     906: invokevirtual #96                 // Method java/lang/Number.doubleValue:()D
     909: dstore        33
     911: iconst_1
     912: i2d
     913: aload_3
     914: checkcast     #52                 // class java/util/Collection
     917: invokestatic  #82                 // Method kotlin/collections/CollectionsKt.getIndices:(Ljava/util/Collection;)Lkotlin/ranges/IntRange;
     920: checkcast     #46                 // class java/lang/Iterable
     923: astore        24
     925: dstore        35
     927: iconst_0
     928: istore        25
     930: dconst_0
     931: dstore        37
     933: aload         24
     935: invokeinterface #56,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     940: astore        29
     942: aload         29
     944: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     949: ifeq          1022
     952: aload         29
     954: checkcast     #84                 // class kotlin/collections/IntIterator
     957: invokevirtual #87                 // Method kotlin/collections/IntIterator.nextInt:()I
     960: istore        39
     962: dload         37
     964: iload         39
     966: istore        40
     968: dstore        41
     970: iconst_0
     971: istore        43
     973: aload_3
     974: iload         14
     976: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     981: checkcast     #74                 // class "[D"
     984: iload         40
     986: daload
     987: aload         4
     989: iload         14
     991: iload         10
     993: aload         5
     995: iload         40
     997: invokestatic  #100                // Method main$lambda$7$newPotential:(Ljava/util/List;IILjava/util/List;I)D
    1000: dload         31
    1002: dsub
    1003: dmul
    1004: dload         33
    1006: dload         31
    1008: dsub
    1009: ddiv
    1010: dstore        44
    1012: dload         41
    1014: dload         44
    1016: dadd
    1017: dstore        37
    1019: goto          942
    1022: dload         37
    1024: dstore        41
    1026: dload         35
    1028: dload         41
    1030: ddiv
    1031: dstore        17
    1033: aload         16
    1035: iload         15
    1037: dload         17
    1039: dastore
    1040: iinc          12, 1
    1043: goto          688
    1046: aload         13
    1048: nop
    1049: aload         46
    1051: swap
    1052: invokevirtual #32                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
    1055: pop
    1056: iinc          8, 1
    1059: goto          658
    1062: aload         7
    1064: checkcast     #12                 // class java/util/List
    1067: astore        6
    1069: invokestatic  #103                // Method readInt:()I
    1072: istore        7
    1074: new           #24                 // class java/util/ArrayList
    1077: dup
    1078: iload         7
    1080: invokespecial #28                 // Method java/util/ArrayList."<init>":(I)V
    1083: astore        8
    1085: iconst_0
    1086: istore        9
    1088: iload         9
    1090: iload         7
    1092: if_icmpge     1288
    1095: iload         9
    1097: istore        10
    1099: aload         8
    1101: iload         10
    1103: istore        11
    1105: astore        46
    1107: iconst_0
    1108: istore        12
    1110: invokestatic  #10                 // Method readInts:()Ljava/util/List;
    1113: checkcast     #46                 // class java/lang/Iterable
    1116: astore        13
    1118: iconst_0
    1119: istore        14
    1121: aload         13
    1123: astore        15
    1125: new           #24                 // class java/util/ArrayList
    1128: dup
    1129: aload         13
    1131: bipush        10
    1133: invokestatic  #50                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
    1136: invokespecial #28                 // Method java/util/ArrayList."<init>":(I)V
    1139: checkcast     #52                 // class java/util/Collection
    1142: astore        16
    1144: iconst_0
    1145: istore        17
    1147: aload         15
    1149: invokeinterface #56,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
    1154: astore        18
    1156: aload         18
    1158: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
    1163: ifeq          1211
    1166: aload         18
    1168: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
    1173: astore        19
    1175: aload         16
    1177: aload         19
    1179: checkcast     #18                 // class java/lang/Number
    1182: invokevirtual #22                 // Method java/lang/Number.intValue:()I
    1185: istore        20
    1187: astore        21
    1189: iconst_0
    1190: istore        23
    1192: iload         20
    1194: iconst_1
    1195: isub
    1196: invokestatic  #38                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
    1199: aload         21
    1201: swap
    1202: invokeinterface #67,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
    1207: pop
    1208: goto          1156
    1211: aload         16
    1213: checkcast     #12                 // class java/util/List
    1216: nop
    1217: checkcast     #46                 // class java/lang/Iterable
    1220: invokestatic  #106                // Method kotlin/collections/CollectionsKt.sorted:(Ljava/lang/Iterable;)Ljava/util/List;
    1223: astore        24
    1225: aload         24
    1227: iconst_0
    1228: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
    1233: checkcast     #18                 // class java/lang/Number
    1236: invokevirtual #22                 // Method java/lang/Number.intValue:()I
    1239: istore        13
    1241: aload         24
    1243: iconst_1
    1244: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
    1249: checkcast     #18                 // class java/lang/Number
    1252: invokevirtual #22                 // Method java/lang/Number.intValue:()I
    1255: istore        14
    1257: aload         6
    1259: iload         14
    1261: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
    1266: checkcast     #74                 // class "[D"
    1269: iload         13
    1271: daload
    1272: invokestatic  #92                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
    1275: aload         46
    1277: swap
    1278: invokevirtual #32                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
    1281: pop
    1282: iinc          9, 1
    1285: goto          1088
    1288: aload         8
    1290: checkcast     #12                 // class java/util/List
    1293: checkcast     #46                 // class java/lang/Iterable
    1296: ldc           #108                // String \n
    1298: checkcast     #110                // class java/lang/CharSequence
    1301: aconst_null
    1302: aconst_null
    1303: iconst_0
    1304: aconst_null
    1305: aconst_null
    1306: bipush        62
    1308: aconst_null
    1309: invokestatic  #114                // 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;
    1312: astore        7
    1314: getstatic     #120                // Field java/lang/System.out:Ljava/io/PrintStream;
    1317: aload         7
    1319: invokevirtual #126                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
    1322: return

  private static final double[] kirchhoff(java.util.List<double[]>, int, int);
    Code:
       0: aload_0
       1: checkcast     #46                 // class java/lang/Iterable
       4: astore        4
       6: iconst_0
       7: istore        5
       9: aload         4
      11: astore        6
      13: new           #24                 // class java/util/ArrayList
      16: dup
      17: aload         4
      19: bipush        10
      21: invokestatic  #50                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      24: invokespecial #28                 // Method java/util/ArrayList."<init>":(I)V
      27: checkcast     #52                 // class java/util/Collection
      30: astore        7
      32: iconst_0
      33: istore        8
      35: aload         6
      37: invokeinterface #56,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      42: astore        9
      44: aload         9
      46: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      51: ifeq          97
      54: aload         9
      56: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      61: astore        10
      63: aload         7
      65: aload         10
      67: checkcast     #74                 // class "[D"
      70: astore        11
      72: astore        13
      74: iconst_0
      75: istore        12
      77: aload         11
      79: invokevirtual #172                // Method java/lang/Object.clone:()Ljava/lang/Object;
      82: checkcast     #74                 // class "[D"
      85: aload         13
      87: swap
      88: invokeinterface #67,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      93: pop
      94: goto          44
      97: aload         7
      99: checkcast     #12                 // class java/util/List
     102: nop
     103: astore_3
     104: iconst_2
     105: anewarray     #34                 // class java/lang/Integer
     108: astore        4
     110: aload         4
     112: iconst_0
     113: iload_1
     114: invokestatic  #38                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     117: aastore
     118: aload         4
     120: iconst_1
     121: iload_2
     122: invokestatic  #38                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     125: aastore
     126: aload         4
     128: invokestatic  #44                 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
     131: checkcast     #46                 // class java/lang/Iterable
     134: astore        4
     136: iconst_0
     137: istore        5
     139: aload         4
     141: invokeinterface #56,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     146: astore        6
     148: aload         6
     150: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     155: ifeq          219
     158: aload         6
     160: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     165: astore        7
     167: aload         7
     169: checkcast     #18                 // class java/lang/Number
     172: invokevirtual #22                 // Method java/lang/Number.intValue:()I
     175: istore        8
     177: iconst_0
     178: istore        9
     180: aload_3
     181: iload         8
     183: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     188: checkcast     #74                 // class "[D"
     191: dconst_0
     192: iconst_0
     193: iconst_0
     194: bipush        6
     196: aconst_null
     197: invokestatic  #178                // Method kotlin/collections/ArraysKt.fill$default:([DDIIILjava/lang/Object;)V
     200: aload_3
     201: iload         8
     203: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     208: checkcast     #74                 // class "[D"
     211: iload         8
     213: dconst_1
     214: dastore
     215: nop
     216: goto          148
     219: nop
     220: aload_3
     221: invokeinterface #181,  1          // InterfaceMethod java/util/List.size:()I
     226: newarray       double
     228: astore        5
     230: aload         5
     232: astore        6
     234: iconst_0
     235: istore        7
     237: aload         6
     239: iload_2
     240: dconst_1
     241: dastore
     242: aload         5
     244: astore        4
     246: aload_3
     247: aload         4
     249: invokestatic  #185                // Method gauss:(Ljava/util/List;[D)[D
     252: areturn

  private static final double[] gauss(java.util.List<double[]>, double[]);
    Code:
       0: aload_0
       1: invokeinterface #181,  1          // InterfaceMethod java/util/List.size:()I
       6: istore_2
       7: aload_0
       8: iconst_0
       9: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      14: checkcast     #74                 // class "[D"
      17: arraylength
      18: istore_3
      19: iload_2
      20: newarray       int
      22: astore        4
      24: iconst_0
      25: istore        5
      27: iload         5
      29: iload_2
      30: if_icmpge     323
      33: aload_0
      34: iload         5
      36: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      41: checkcast     #74                 // class "[D"
      44: astore        6
      46: iconst_0
      47: iload_3
      48: invokestatic  #199                // Method kotlin/ranges/RangesKt.until:(II)Lkotlin/ranges/IntRange;
      51: checkcast     #46                 // class java/lang/Iterable
      54: astore        8
      56: iconst_0
      57: istore        9
      59: aload         8
      61: invokeinterface #56,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      66: astore        10
      68: aload         10
      70: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      75: ifne          82
      78: aconst_null
      79: goto          191
      82: aload         10
      84: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      89: astore        11
      91: aload         10
      93: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      98: ifne          106
     101: aload         11
     103: goto          191
     106: aload         11
     108: checkcast     #18                 // class java/lang/Number
     111: invokevirtual #22                 // Method java/lang/Number.intValue:()I
     114: istore        12
     116: iconst_0
     117: istore        14
     119: aload         6
     121: iload         12
     123: daload
     124: invokestatic  #203                // Method abs:(D)D
     127: dstore        12
     129: aload         10
     131: invokeinterface #66,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     136: astore        14
     138: aload         14
     140: checkcast     #18                 // class java/lang/Number
     143: invokevirtual #22                 // Method java/lang/Number.intValue:()I
     146: istore        15
     148: iconst_0
     149: istore        17
     151: aload         6
     153: iload         15
     155: daload
     156: invokestatic  #203                // Method abs:(D)D
     159: dstore        15
     161: dload         12
     163: dload         15
     165: invokestatic  #207                // Method java/lang/Double.compare:(DD)I
     168: ifge          179
     171: aload         14
     173: astore        11
     175: dload         15
     177: dstore        12
     179: aload         10
     181: invokeinterface #62,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     186: ifne          129
     189: aload         11
     191: dup
     192: invokestatic  #212                // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     195: checkcast     #18                 // class java/lang/Number
     198: invokevirtual #22                 // Method java/lang/Number.intValue:()I
     201: istore        7
     203: aload         4
     205: iload         5
     207: iload         7
     209: iastore
     210: iconst_0
     211: istore        8
     213: iload         8
     215: iload_2
     216: if_icmpge     317
     219: iload         8
     221: iload         5
     223: if_icmpeq     311
     226: aload_0
     227: iload         8
     229: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     234: checkcast     #74                 // class "[D"
     237: astore        9
     239: aload         9
     241: iload         7
     243: daload
     244: dneg
     245: aload         6
     247: iload         7
     249: daload
     250: ddiv
     251: dstore        10
     253: iconst_0
     254: istore        12
     256: iload         12
     258: iload_3
     259: if_icmpge     291
     262: iload         12
     264: istore        14
     266: aload         9
     268: iload         14
     270: aload         9
     272: iload         14
     274: daload
     275: dload         10
     277: aload         6
     279: iload         12
     281: daload
     282: dmul
     283: dadd
     284: dastore
     285: iinc          12, 1
     288: goto          256
     291: iload         8
     293: istore        12
     295: aload_1
     296: iload         12
     298: aload_1
     299: iload         12
     301: daload
     302: dload         10
     304: aload_1
     305: iload         5
     307: daload
     308: dmul
     309: dadd
     310: dastore
     311: iinc          8, 1
     314: goto          213
     317: iinc          5, 1
     320: goto          27
     323: iload_3
     324: newarray       double
     326: astore        5
     328: iconst_0
     329: istore        6
     331: iload         6
     333: iload_2
     334: if_icmpge     373
     337: aload         5
     339: aload         4
     341: iload         6
     343: iaload
     344: aload_1
     345: iload         6
     347: daload
     348: aload_0
     349: iload         6
     351: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     356: checkcast     #74                 // class "[D"
     359: aload         4
     361: iload         6
     363: iaload
     364: daload
     365: ddiv
     366: dastore
     367: iinc          6, 1
     370: goto          331
     373: aload         5
     375: areturn

  private static final <T> java.util.List<java.util.List<T>> withReversed(java.lang.Iterable<? extends T>);
    Code:
       0: iconst_2
       1: anewarray     #12                 // class java/util/List
       4: astore_1
       5: aload_1
       6: iconst_0
       7: aload_0
       8: invokestatic  #237                // Method kotlin/collections/CollectionsKt.toList:(Ljava/lang/Iterable;)Ljava/util/List;
      11: aastore
      12: aload_1
      13: iconst_1
      14: aload_0
      15: invokestatic  #240                // Method kotlin/collections/CollectionsKt.reversed:(Ljava/lang/Iterable;)Ljava/util/List;
      18: aastore
      19: aload_1
      20: invokestatic  #44                 // Method kotlin/collections/CollectionsKt.listOf:([Ljava/lang/Object;)Ljava/util/List;
      23: areturn

  private static final double abs(double);
    Code:
       0: dload_0
       1: invokestatic  #244                // Method java/lang/Math.abs:(D)D
       4: dreturn

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

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

  private static final java.util.List<java.lang.String> readStrings();
    Code:
       0: invokestatic  #254                // Method readLn:()Ljava/lang/String;
       3: checkcast     #110                // class java/lang/CharSequence
       6: iconst_1
       7: anewarray     #262                // class java/lang/String
      10: astore_0
      11: aload_0
      12: iconst_0
      13: ldc_w         #264                // String
      16: aastore
      17: aload_0
      18: iconst_0
      19: iconst_0
      20: bipush        6
      22: aconst_null
      23: invokestatic  #270                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      26: areturn

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

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

  private static final double main$lambda$7$newPotential(java.util.List<double[]>, int, int, java.util.List<java.lang.Double>, int);
    Code:
       0: aload_0
       1: iload_1
       2: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
       7: checkcast     #74                 // class "[D"
      10: iload         4
      12: daload
      13: aload_0
      14: iload_2
      15: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      20: checkcast     #74                 // class "[D"
      23: iload         4
      25: daload
      26: aload_3
      27: iload_1
      28: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      33: checkcast     #18                 // class java/lang/Number
      36: invokevirtual #96                 // Method java/lang/Number.doubleValue:()D
      39: dmul
      40: aload_3
      41: iload_2
      42: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      47: checkcast     #18                 // class java/lang/Number
      50: invokevirtual #96                 // Method java/lang/Number.doubleValue:()D
      53: ddiv
      54: dsub
      55: dreturn
}


package workshops.moscow_prefinals2020.day4

fun main() {
	val s = readLine()!!
	val initMask = s.reversed().replace("(", "0").replace(")", "1").toLong(2)
	val memo = List(s.length + 1) { mutableMapOf<Long, Double>() }
	memo[0][0] = 1.0
	fun solve(n: Int, mask: Long): Double {
		memo[n][mask]?.also { return it }
		if ((mask and 1) != 0L || (mask shr (n - 1)) == 0L) return 0.0
		var options = 0
		var sum = 0.0
		for (j in 0 until n) if (((mask shr j) and 1L) != 0L) {
			for (i in 0 until j) if (((mask shr i) and 1L) == 0L) {
				sum += solve(n - 2, (if (j + 1 < n) (mask shr (j + 1) shl (j - 1)) else 0) +
						(if (i + 1 < j) ((mask and ((1L shl j) - 1)) shr (i + 1) shl i) else 0) +
						(if (0 < i) (mask and ((1L shl i) - 1)) else 0))
				options++
			}
		}
		val res = if (options == 0) 0.0 else sum / options
		memo[n][mask] = res
		return res
	}
	println(solve(s.length, initMask))
}

Compiled from "c.kt"
public final class workshops.moscow_prefinals2020.day4.CKt {
  public static final void main();
    Code:
       0: invokestatic  #12                 // Method kotlin/io/ConsoleKt.readLine:()Ljava/lang/String;
       3: dup
       4: invokestatic  #18                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
       7: astore_0
       8: aload_0
       9: checkcast     #20                 // class java/lang/CharSequence
      12: invokestatic  #26                 // Method kotlin/text/StringsKt.reversed:(Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
      15: invokevirtual #29                 // Method java/lang/Object.toString:()Ljava/lang/String;
      18: ldc           #31                 // String (
      20: ldc           #33                 // String 0
      22: iconst_0
      23: iconst_4
      24: aconst_null
      25: invokestatic  #37                 // Method kotlin/text/StringsKt.replace$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Ljava/lang/String;
      28: ldc           #39                 // String )
      30: ldc           #41                 // String 1
      32: iconst_0
      33: iconst_4
      34: aconst_null
      35: invokestatic  #37                 // Method kotlin/text/StringsKt.replace$default:(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZILjava/lang/Object;)Ljava/lang/String;
      38: iconst_2
      39: invokestatic  #47                 // Method kotlin/text/CharsKt.checkRadix:(I)I
      42: invokestatic  #53                 // Method java/lang/Long.parseLong:(Ljava/lang/String;I)J
      45: lstore_1
      46: aload_0
      47: invokevirtual #59                 // Method java/lang/String.length:()I
      50: iconst_1
      51: iadd
      52: istore        4
      54: new           #61                 // class java/util/ArrayList
      57: dup
      58: iload         4
      60: invokespecial #65                 // Method java/util/ArrayList."<init>":(I)V
      63: astore        5
      65: iconst_0
      66: istore        6
      68: iload         6
      70: iload         4
      72: if_icmpge     114
      75: iload         6
      77: istore        7
      79: aload         5
      81: iload         7
      83: istore        8
      85: astore        10
      87: iconst_0
      88: istore        9
      90: new           #67                 // class java/util/LinkedHashMap
      93: dup
      94: invokespecial #69                 // Method java/util/LinkedHashMap."<init>":()V
      97: checkcast     #71                 // class java/util/Map
     100: nop
     101: aload         10
     103: swap
     104: invokevirtual #75                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
     107: pop
     108: iinc          6, 1
     111: goto          68
     114: aload         5
     116: checkcast     #77                 // class java/util/List
     119: astore_3
     120: aload_3
     121: iconst_0
     122: invokeinterface #81,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     127: checkcast     #71                 // class java/util/Map
     130: lconst_0
     131: invokestatic  #85                 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
     134: dconst_1
     135: invokestatic  #90                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     138: invokeinterface #94,  3           // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     143: pop
     144: aload_3
     145: aload_0
     146: invokevirtual #59                 // Method java/lang/String.length:()I
     149: lload_1
     150: invokestatic  #98                 // Method main$solve:(Ljava/util/List;IJ)D
     153: dstore        4
     155: getstatic     #104                // Field java/lang/System.out:Ljava/io/PrintStream;
     158: dload         4
     160: invokevirtual #110                // Method java/io/PrintStream.println:(D)V
     163: return

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

  private static final double main$solve(java.util.List<? extends java.util.Map<java.lang.Long, java.lang.Double>>, int, long);
    Code:
       0: aload_0
       1: iload_1
       2: invokeinterface #81,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
       7: checkcast     #71                 // class java/util/Map
      10: lload_2
      11: invokestatic  #85                 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
      14: invokeinterface #128,  2          // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
      19: checkcast     #87                 // class java/lang/Double
      22: astore        4
      24: aload         4
      26: ifnull        45
      29: aload         4
      31: checkcast     #130                // class java/lang/Number
      34: invokevirtual #134                // Method java/lang/Number.doubleValue:()D
      37: dstore        6
      39: iconst_0
      40: istore        8
      42: dload         6
      44: dreturn
      45: nop
      46: lload_2
      47: lconst_1
      48: land
      49: lconst_0
      50: lcmp
      51: ifne          64
      54: lload_2
      55: iload_1
      56: iconst_1
      57: isub
      58: lshr
      59: lconst_0
      60: lcmp
      61: ifne          66
      64: dconst_0
      65: dreturn
      66: iconst_0
      67: istore        4
      69: dconst_0
      70: dstore        5
      72: iconst_0
      73: istore        7
      75: iload         7
      77: iload_1
      78: if_icmpge     212
      81: lload_2
      82: iload         7
      84: lshr
      85: lconst_1
      86: land
      87: lconst_0
      88: lcmp
      89: ifeq          206
      92: iconst_0
      93: istore        8
      95: iload         8
      97: iload         7
      99: if_icmpge     206
     102: lload_2
     103: iload         8
     105: lshr
     106: lconst_1
     107: land
     108: lconst_0
     109: lcmp
     110: ifne          200
     113: dload         5
     115: aload_0
     116: iload_1
     117: iconst_2
     118: isub
     119: iload         7
     121: iconst_1
     122: iadd
     123: iload_1
     124: if_icmpge     141
     127: lload_2
     128: iload         7
     130: iconst_1
     131: iadd
     132: lshr
     133: iload         7
     135: iconst_1
     136: isub
     137: lshl
     138: goto          142
     141: lconst_0
     142: iload         8
     144: iconst_1
     145: iadd
     146: iload         7
     148: if_icmpge     170
     151: lload_2
     152: lconst_1
     153: iload         7
     155: lshl
     156: lconst_1
     157: lsub
     158: land
     159: iload         8
     161: iconst_1
     162: iadd
     163: lshr
     164: iload         8
     166: lshl
     167: goto          171
     170: lconst_0
     171: ladd
     172: iconst_0
     173: iload         8
     175: if_icmpge     189
     178: lload_2
     179: lconst_1
     180: iload         8
     182: lshl
     183: lconst_1
     184: lsub
     185: land
     186: goto          190
     189: lconst_0
     190: ladd
     191: invokestatic  #98                 // Method main$solve:(Ljava/util/List;IJ)D
     194: dadd
     195: dstore        5
     197: iinc          4, 1
     200: iinc          8, 1
     203: goto          95
     206: iinc          7, 1
     209: goto          75
     212: iload         4
     214: ifne          221
     217: dconst_0
     218: goto          227
     221: dload         5
     223: iload         4
     225: i2d
     226: ddiv
     227: dstore        7
     229: lload_2
     230: invokestatic  #85                 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
     233: astore        9
     235: dload         7
     237: invokestatic  #90                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     240: astore        10
     242: aload_0
     243: iload_1
     244: invokeinterface #81,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     249: checkcast     #71                 // class java/util/Map
     252: aload         9
     254: aload         10
     256: invokeinterface #94,  3           // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
     261: pop
     262: dload         7
     264: dreturn
}


package workshops.moscow_prefinals2020.day3

fun main() {
	val (x, y, z) = List(3) { readInts().drop(1).reversed() }
	var (low, high) = maxOf((x + y + z).maxOrNull()!!, 1).toLong() to Long.MAX_VALUE / 2
	binarySearch@while (low + 1 < high) {
		val b = (low + high) / 2
		val zNew = LongArray(z.size)
		var tooLarge = false
		fun add(index: Int, value: Long) {
			if (index >= zNew.size) tooLarge = true else zNew[index] += value
		}
		for (i in x.indices) for (j in y.indices) {
			add(i + j, x[i].toLong() * y[j])
			for (k in i + j until zNew.size) {
				if (zNew[k] < b) break
				add(k + 1, zNew[k] / b)
				zNew[k] %= b
			}
			if (tooLarge) {
				low = b
				continue@binarySearch
			}
		}
		for (k in zNew.indices.reversed()) {
			if (zNew[k] == z[k].toLong()) continue
			if (zNew[k] > z[k]) low = b else high = b
			continue@binarySearch
		}
		return println(b)
	}
	println("impossible")
}

private fun readLn() = readLine()!!
private fun readStrings() = readLn().split(" ")
private fun readInts() = readStrings().map { it.toInt() }

Compiled from "k.kt"
public final class workshops.moscow_prefinals2020.day3.KKt {
  public static final void main();
    Code:
       0: iconst_3
       1: istore_1
       2: new           #8                  // class java/util/ArrayList
       5: dup
       6: iload_1
       7: invokespecial #12                 // Method java/util/ArrayList."<init>":(I)V
      10: astore_2
      11: iconst_0
      12: istore_3
      13: iload_3
      14: iload_1
      15: if_icmpge     60
      18: iload_3
      19: istore        4
      21: aload_2
      22: iload         4
      24: istore        5
      26: astore        20
      28: iconst_0
      29: istore        6
      31: invokestatic  #16                 // Method readInts:()Ljava/util/List;
      34: checkcast     #18                 // class java/lang/Iterable
      37: iconst_1
      38: invokestatic  #24                 // Method kotlin/collections/CollectionsKt.drop:(Ljava/lang/Iterable;I)Ljava/util/List;
      41: checkcast     #18                 // class java/lang/Iterable
      44: invokestatic  #28                 // Method kotlin/collections/CollectionsKt.reversed:(Ljava/lang/Iterable;)Ljava/util/List;
      47: aload         20
      49: swap
      50: invokevirtual #32                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
      53: pop
      54: iinc          3, 1
      57: goto          13
      60: aload_2
      61: checkcast     #34                 // class java/util/List
      64: astore_0
      65: aload_0
      66: iconst_0
      67: invokeinterface #38,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      72: checkcast     #34                 // class java/util/List
      75: astore_1
      76: aload_0
      77: iconst_1
      78: invokeinterface #38,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      83: checkcast     #34                 // class java/util/List
      86: astore_2
      87: aload_0
      88: iconst_2
      89: invokeinterface #38,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      94: checkcast     #34                 // class java/util/List
      97: astore_3
      98: aload_1
      99: checkcast     #40                 // class java/util/Collection
     102: aload_2
     103: checkcast     #18                 // class java/lang/Iterable
     106: invokestatic  #44                 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;
     109: checkcast     #40                 // class java/util/Collection
     112: aload_3
     113: checkcast     #18                 // class java/lang/Iterable
     116: invokestatic  #44                 // Method kotlin/collections/CollectionsKt.plus:(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List;
     119: checkcast     #18                 // class java/lang/Iterable
     122: invokestatic  #48                 // Method kotlin/collections/CollectionsKt.maxOrNull:(Ljava/lang/Iterable;)Ljava/lang/Comparable;
     125: dup
     126: invokestatic  #54                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     129: checkcast     #56                 // class java/lang/Number
     132: invokevirtual #60                 // Method java/lang/Number.intValue:()I
     135: iconst_1
     136: invokestatic  #66                 // Method java/lang/Math.max:(II)I
     139: i2l
     140: invokestatic  #72                 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
     143: ldc2_w        #73                 // long 4611686018427387903l
     146: invokestatic  #72                 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
     149: invokestatic  #80                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
     152: astore        4
     154: aload         4
     156: invokevirtual #86                 // Method kotlin/Pair.component1:()Ljava/lang/Object;
     159: checkcast     #56                 // class java/lang/Number
     162: invokevirtual #90                 // Method java/lang/Number.longValue:()J
     165: lstore        5
     167: aload         4
     169: invokevirtual #93                 // Method kotlin/Pair.component2:()Ljava/lang/Object;
     172: checkcast     #56                 // class java/lang/Number
     175: invokevirtual #90                 // Method java/lang/Number.longValue:()J
     178: lstore        7
     180: lload         5
     182: lconst_1
     183: ladd
     184: lload         7
     186: lcmp
     187: ifge          499
     190: lload         5
     192: lload         7
     194: ladd
     195: iconst_2
     196: i2l
     197: ldiv
     198: lstore        9
     200: aload_3
     201: invokeinterface #96,  1           // InterfaceMethod java/util/List.size:()I
     206: newarray       long
     208: astore        11
     210: new           #98                 // class kotlin/jvm/internal/Ref$BooleanRef
     213: dup
     214: invokespecial #100                // Method kotlin/jvm/internal/Ref$BooleanRef."<init>":()V
     217: astore        12
     219: iconst_0
     220: istore        13
     222: aload_1
     223: checkcast     #40                 // class java/util/Collection
     226: invokeinterface #101,  1          // InterfaceMethod java/util/Collection.size:()I
     231: istore        14
     233: iload         13
     235: iload         14
     237: if_icmpge     402
     240: iconst_0
     241: istore        15
     243: aload_2
     244: checkcast     #40                 // class java/util/Collection
     247: invokeinterface #101,  1          // InterfaceMethod java/util/Collection.size:()I
     252: istore        16
     254: iload         15
     256: iload         16
     258: if_icmpge     396
     261: aload         11
     263: aload         12
     265: iload         13
     267: iload         15
     269: iadd
     270: aload_1
     271: iload         13
     273: invokeinterface #38,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     278: checkcast     #56                 // class java/lang/Number
     281: invokevirtual #60                 // Method java/lang/Number.intValue:()I
     284: i2l
     285: aload_2
     286: iload         15
     288: invokeinterface #38,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     293: checkcast     #56                 // class java/lang/Number
     296: invokevirtual #90                 // Method java/lang/Number.longValue:()J
     299: lmul
     300: invokestatic  #105                // Method main$add:([JLkotlin/jvm/internal/Ref$BooleanRef;IJ)V
     303: iload         13
     305: iload         15
     307: iadd
     308: istore        17
     310: aload         11
     312: arraylength
     313: istore        18
     315: iload         17
     317: iload         18
     319: if_icmpge     375
     322: aload         11
     324: iload         17
     326: laload
     327: lload         9
     329: lcmp
     330: iflt          375
     333: aload         11
     335: aload         12
     337: iload         17
     339: iconst_1
     340: iadd
     341: aload         11
     343: iload         17
     345: laload
     346: lload         9
     348: ldiv
     349: invokestatic  #105                // Method main$add:([JLkotlin/jvm/internal/Ref$BooleanRef;IJ)V
     352: iload         17
     354: istore        19
     356: aload         11
     358: iload         19
     360: aload         11
     362: iload         19
     364: laload
     365: lload         9
     367: lrem
     368: lastore
     369: iinc          17, 1
     372: goto          315
     375: aload         12
     377: getfield      #109                // Field kotlin/jvm/internal/Ref$BooleanRef.element:Z
     380: ifeq          390
     383: lload         9
     385: lstore        5
     387: goto          180
     390: iinc          15, 1
     393: goto          254
     396: iinc          13, 1
     399: goto          233
     402: aload         11
     404: arraylength
     405: iconst_m1
     406: iadd
     407: istore        13
     409: iconst_0
     410: iload         13
     412: if_icmpgt     490
     415: iload         13
     417: istore        14
     419: iinc          13, -1
     422: aload         11
     424: iload         14
     426: laload
     427: aload_3
     428: iload         14
     430: invokeinterface #38,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     435: checkcast     #56                 // class java/lang/Number
     438: invokevirtual #60                 // Method java/lang/Number.intValue:()I
     441: i2l
     442: lcmp
     443: ifeq          484
     446: aload         11
     448: iload         14
     450: laload
     451: aload_3
     452: iload         14
     454: invokeinterface #38,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     459: checkcast     #56                 // class java/lang/Number
     462: invokevirtual #60                 // Method java/lang/Number.intValue:()I
     465: i2l
     466: lcmp
     467: ifle          477
     470: lload         9
     472: lstore        5
     474: goto          481
     477: lload         9
     479: lstore        7
     481: goto          180
     484: iconst_0
     485: iload         13
     487: if_icmple     415
     490: getstatic     #115                // Field java/lang/System.out:Ljava/io/PrintStream;
     493: lload         9
     495: invokevirtual #121                // Method java/io/PrintStream.println:(J)V
     498: return
     499: ldc           #123                // String impossible
     501: getstatic     #115                // Field java/lang/System.out:Ljava/io/PrintStream;
     504: swap
     505: invokevirtual #125                // Method java/io/PrintStream.println:(Ljava/lang/Object;)V
     508: return

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

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

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

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

  private static final void main$add(long[], kotlin.jvm.internal.Ref$BooleanRef, int, long);
    Code:
       0: iload_2
       1: aload_0
       2: arraylength
       3: if_icmplt     14
       6: aload_1
       7: iconst_1
       8: putfield      #109                // Field kotlin/jvm/internal/Ref$BooleanRef.element:Z
      11: goto          22
      14: aload_0
      15: iload_2
      16: aload_0
      17: iload_2
      18: laload
      19: lload_3
      20: ladd
      21: lastore
      22: return
}


package workshops.moscow_prefinals2020.day3

private fun solve() {
	val a = mutableMapOf<Int, MutableMap<Int, Int>>()
	var ans = 0
	repeat(readInt()) {
		val (s, vIn) = readStrings()
		val v = vIn.toInt()
		if (v <= 0) return@repeat
		val hashing = Hashing(s)
		var maxSeen = 0
		for (len in a.keys) if (len < s.length) {
			val map = a[len]!!
			for (i in 0..s.length - len) {
				val hash = hashing.hash(i, i + len)
				val score = map[hash] ?: continue
				maxSeen = maxOf(maxSeen, score)
			}
		}
		val map = a.computeIfAbsent(s.length) { mutableMapOf() }
		val hash = hashing.hash(0, s.length)
		val score = map.compute(hash) { _, oldValue -> v + maxOf(maxSeen, oldValue ?: 0) }!!
		ans = maxOf(ans, score)
	}
	println(ans)
}

private const val M = 1_000_000_007

private class Hashing(s: String, x: Int = 566239) {
	val h = IntArray(s.length + 1)
	val t = IntArray(s.length + 1)

	fun hash(from: Int, to: Int): Int {
		var res = ((h[to] - h[from] * t[to - from].toLong()) % M).toInt()
		if (res < 0) res += M
		return res
	}

	init {
		t[0] = 1
		for (i in s.indices) {
			t[i + 1] = (t[i] * x.toLong() % M).toInt()
			h[i + 1] = ((h[i] * x.toLong() + s[i].toLong()) % M).toInt()
		}
	}
}

fun main() = repeat(readInt()) { solve() }

private fun readLn() = readLine()!!
private fun readInt() = readLn().toInt()
private fun readStrings() = readLn().split(" ")

Compiled from "l.kt"
public final class workshops.moscow_prefinals2020.day3.LKt {
  private static final int M;

  private static final void solve();
    Code:
       0: new           #8                  // class java/util/LinkedHashMap
       3: dup
       4: invokespecial #11                 // Method java/util/LinkedHashMap."<init>":()V
       7: checkcast     #13                 // class java/util/Map
      10: astore_0
      11: iconst_0
      12: istore_1
      13: invokestatic  #17                 // Method readInt:()I
      16: istore_2
      17: iconst_0
      18: istore_3
      19: iload_3
      20: iload_2
      21: if_icmpge     357
      24: iload_3
      25: istore        4
      27: iconst_0
      28: istore        5
      30: invokestatic  #21                 // Method readStrings:()Ljava/util/List;
      33: astore        6
      35: aload         6
      37: iconst_0
      38: invokeinterface #27,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      43: checkcast     #29                 // class java/lang/String
      46: astore        7
      48: aload         6
      50: iconst_1
      51: invokeinterface #27,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      56: checkcast     #29                 // class java/lang/String
      59: astore        8
      61: aload         8
      63: invokestatic  #35                 // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      66: istore        9
      68: iload         9
      70: ifle          351
      73: new           #37                 // class workshops/moscow_prefinals2020/day3/Hashing
      76: dup
      77: aload         7
      79: iconst_0
      80: iconst_2
      81: aconst_null
      82: invokespecial #40                 // Method workshops/moscow_prefinals2020/day3/Hashing."<init>":(Ljava/lang/String;IILkotlin/jvm/internal/DefaultConstructorMarker;)V
      85: astore        10
      87: new           #42                 // class kotlin/jvm/internal/Ref$IntRef
      90: dup
      91: invokespecial #43                 // Method kotlin/jvm/internal/Ref$IntRef."<init>":()V
      94: astore        11
      96: aload_0
      97: invokeinterface #47,  1           // InterfaceMethod java/util/Map.keySet:()Ljava/util/Set;
     102: invokeinterface #53,  1           // InterfaceMethod java/util/Set.iterator:()Ljava/util/Iterator;
     107: astore        12
     109: aload         12
     111: invokeinterface #59,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     116: ifeq          257
     119: aload         12
     121: invokeinterface #63,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     126: checkcast     #65                 // class java/lang/Number
     129: invokevirtual #68                 // Method java/lang/Number.intValue:()I
     132: istore        13
     134: iload         13
     136: aload         7
     138: invokevirtual #71                 // Method java/lang/String.length:()I
     141: if_icmpge     109
     144: aload_0
     145: iload         13
     147: invokestatic  #75                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     150: invokeinterface #78,  2           // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     155: dup
     156: invokestatic  #84                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     159: checkcast     #13                 // class java/util/Map
     162: astore        14
     164: iconst_0
     165: istore        15
     167: aload         7
     169: invokevirtual #71                 // Method java/lang/String.length:()I
     172: iload         13
     174: isub
     175: istore        16
     177: iload         15
     179: iload         16
     181: if_icmpgt     109
     184: aload         10
     186: iload         15
     188: iload         15
     190: iload         13
     192: iadd
     193: invokevirtual #88                 // Method workshops/moscow_prefinals2020/day3/Hashing.hash:(II)I
     196: istore        17
     198: aload         14
     200: iload         17
     202: invokestatic  #75                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     205: invokeinterface #78,  2           // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     210: checkcast     #31                 // class java/lang/Integer
     213: dup
     214: ifnull        223
     217: invokevirtual #89                 // Method java/lang/Integer.intValue:()I
     220: goto          227
     223: pop
     224: goto          244
     227: istore        18
     229: aload         11
     231: aload         11
     233: getfield      #93                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
     236: iload         18
     238: invokestatic  #98                 // Method java/lang/Math.max:(II)I
     241: putfield      #93                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
     244: iload         15
     246: iload         16
     248: if_icmpeq     109
     251: iinc          15, 1
     254: goto          184
     257: aload_0
     258: aload         7
     260: invokevirtual #71                 // Method java/lang/String.length:()I
     263: invokestatic  #75                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     266: invokedynamic #116,  0            // InvokeDynamic #0:invoke:()Lkotlin/jvm/functions/Function1;
     271: invokedynamic #127,  0            // InvokeDynamic #1:apply:(Lkotlin/jvm/functions/Function1;)Ljava/util/function/Function;
     276: invokeinterface #131,  3          // InterfaceMethod java/util/Map.computeIfAbsent:(Ljava/lang/Object;Ljava/util/function/Function;)Ljava/lang/Object;
     281: dup
     282: ldc           #133                // String computeIfAbsent(...)
     284: invokestatic  #137                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
     287: checkcast     #13                 // class java/util/Map
     290: astore        12
     292: aload         10
     294: iconst_0
     295: aload         7
     297: invokevirtual #71                 // Method java/lang/String.length:()I
     300: invokevirtual #88                 // Method workshops/moscow_prefinals2020/day3/Hashing.hash:(II)I
     303: istore        13
     305: aload         12
     307: iload         13
     309: invokestatic  #75                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     312: iload         9
     314: aload         11
     316: invokedynamic #149,  0            // InvokeDynamic #2:invoke:(ILkotlin/jvm/internal/Ref$IntRef;)Lkotlin/jvm/functions/Function2;
     321: invokedynamic #159,  0            // InvokeDynamic #3:apply:(Lkotlin/jvm/functions/Function2;)Ljava/util/function/BiFunction;
     326: invokeinterface #163,  3          // InterfaceMethod java/util/Map.compute:(Ljava/lang/Object;Ljava/util/function/BiFunction;)Ljava/lang/Object;
     331: dup
     332: invokestatic  #84                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     335: checkcast     #65                 // class java/lang/Number
     338: invokevirtual #68                 // Method java/lang/Number.intValue:()I
     341: istore        14
     343: iload_1
     344: iload         14
     346: invokestatic  #98                 // Method java/lang/Math.max:(II)I
     349: istore_1
     350: nop
     351: iinc          3, 1
     354: goto          19
     357: iload_1
     358: istore_2
     359: getstatic     #169                // Field java/lang/System.out:Ljava/io/PrintStream;
     362: iload_2
     363: invokevirtual #175                // Method java/io/PrintStream.println:(I)V
     366: return

  public static final void main();
    Code:
       0: invokestatic  #17                 // Method readInt:()I
       3: istore_0
       4: iconst_0
       5: istore_1
       6: iload_1
       7: iload_0
       8: if_icmpge     24
      11: iload_1
      12: istore_2
      13: iconst_0
      14: istore_3
      15: invokestatic  #195                // Method solve:()V
      18: iinc          1, 1
      21: goto          6
      24: return

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

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

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

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

  private static final java.util.Map solve$lambda$4$lambda$0(java.lang.Integer);
    Code:
       0: aload_0
       1: ldc           #222                // String it
       3: invokestatic  #225                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: new           #8                  // class java/util/LinkedHashMap
       9: dup
      10: invokespecial #11                 // Method java/util/LinkedHashMap."<init>":()V
      13: checkcast     #13                 // class java/util/Map
      16: areturn

  private static final java.util.Map solve$lambda$4$lambda$1(kotlin.jvm.functions.Function1, java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: invokeinterface #230,  2          // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;
       7: checkcast     #13                 // class java/util/Map
      10: areturn

  private static final java.lang.Integer solve$lambda$4$lambda$2(int, kotlin.jvm.internal.Ref$IntRef, java.lang.Integer, java.lang.Integer);
    Code:
       0: aload_2
       1: ldc           #236                // String <unused var>
       3: invokestatic  #225                // Method kotlin/jvm/internal/Intrinsics.checkNotNullParameter:(Ljava/lang/Object;Ljava/lang/String;)V
       6: iload_0
       7: aload_1
       8: getfield      #93                 // Field kotlin/jvm/internal/Ref$IntRef.element:I
      11: aload_3
      12: dup
      13: ifnull        22
      16: invokevirtual #89                 // Method java/lang/Integer.intValue:()I
      19: goto          24
      22: pop
      23: iconst_0
      24: invokestatic  #98                 // Method java/lang/Math.max:(II)I
      27: iadd
      28: invokestatic  #75                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      31: areturn

  private static final java.lang.Integer solve$lambda$4$lambda$3(kotlin.jvm.functions.Function2, java.lang.Object, java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: aload_2
       3: invokeinterface #243,  3          // InterfaceMethod kotlin/jvm/functions/Function2.invoke:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
       8: checkcast     #31                 // class java/lang/Integer
      11: areturn
}