package codeforces.round901

private fun solve() {
	fun encode(a: Int, b: Int) = (a.toLong() shl 32) or b.toLong()
	val (a, b, c, d, m) = readIntArray()
	val source = encode(a, b)
	val dest = encode(c, d)
	val queue = mutableListOf<Long>()
	val dist = mutableMapOf<Long, Int>()
	queue.add(source)
	dist[source] = 0
	var low = 0
	while (low < queue.size && dest !in dist) {
		val v = queue[low]
		val di = dist[v]!! + 1
		low++
		fun move(xx: Int, yy: Int) {
			val u = encode(xx, yy)
			if (u in dist) return
			dist[u] = di
			queue.add(u)
		}
		val x = (v shr 32).toInt()
		val y = v.toInt()
		move(x and y, y)
		move(x or y, y)
		move(x, y xor x)
		move(x, y xor m)
	}
	val ans = dist[dest] ?: -1
	out.appendLine(ans.toString())
}

fun main() = repeat(readInt()) { solve() }.also { out.close() }

private fun readInt() = readln().toInt()
private fun readStrings() = readln().split(" ")
private fun readInts() = readStrings().map { it.toInt() }
private fun readIntArray() = readln().parseIntArray()
private fun readLongs() = readStrings().map { it.toLong() }

private fun String.parseIntArray(): IntArray {
	val result = IntArray(count { it == ' ' } + 1)
	var i = 0; var value = 0
	for (c in this) {
		if (c != ' ') {
			value = value * 10 + c.code - '0'.code
			continue
		}
		result[i++] = value
		value = 0
	}
	result[i] = value
	return result
}

private val `in` = System.`in`.bufferedReader()
private val out = System.out.bufferedWriter()
private fun readln() = `in`.readLine()

Compiled from "b_slow.kt"
public final class codeforces.round901.B_slowKt {
  private static final java.io.BufferedReader in;

  private static final java.io.BufferedWriter out;

  private static final void solve();
    Code:
       0: invokestatic  #10                 // Method readIntArray:()[I
       3: astore_0
       4: aload_0
       5: iconst_0
       6: iaload
       7: istore_1
       8: aload_0
       9: iconst_1
      10: iaload
      11: istore_2
      12: aload_0
      13: iconst_2
      14: iaload
      15: istore_3
      16: aload_0
      17: iconst_3
      18: iaload
      19: istore        4
      21: aload_0
      22: iconst_4
      23: iaload
      24: istore        5
      26: iload_1
      27: iload_2
      28: invokestatic  #14                 // Method solve$encode:(II)J
      31: lstore        6
      33: iload_3
      34: iload         4
      36: invokestatic  #14                 // Method solve$encode:(II)J
      39: lstore        8
      41: new           #16                 // class java/util/ArrayList
      44: dup
      45: invokespecial #19                 // Method java/util/ArrayList."<init>":()V
      48: checkcast     #21                 // class java/util/List
      51: astore        10
      53: new           #23                 // class java/util/LinkedHashMap
      56: dup
      57: invokespecial #24                 // Method java/util/LinkedHashMap."<init>":()V
      60: checkcast     #26                 // class java/util/Map
      63: astore        11
      65: aload         10
      67: lload         6
      69: invokestatic  #32                 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
      72: invokeinterface #36,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
      77: pop
      78: lload         6
      80: invokestatic  #32                 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
      83: astore        13
      85: aload         11
      87: aload         13
      89: iconst_0
      90: invokestatic  #41                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      93: invokeinterface #45,  3           // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
      98: pop
      99: iconst_0
     100: istore        12
     102: iload         12
     104: aload         10
     106: invokeinterface #49,  1           // InterfaceMethod java/util/List.size:()I
     111: if_icmpge     256
     114: lload         8
     116: invokestatic  #32                 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
     119: aload         11
     121: swap
     122: invokeinterface #52,  2           // InterfaceMethod java/util/Map.containsKey:(Ljava/lang/Object;)Z
     127: ifne          256
     130: aload         10
     132: iload         12
     134: invokeinterface #56,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     139: checkcast     #58                 // class java/lang/Number
     142: invokevirtual #62                 // Method java/lang/Number.longValue:()J
     145: lstore        13
     147: aload         11
     149: lload         13
     151: invokestatic  #32                 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
     154: invokeinterface #65,  2           // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     159: dup
     160: invokestatic  #71                 // Method kotlin/jvm/internal/Intrinsics.checkNotNull:(Ljava/lang/Object;)V
     163: checkcast     #58                 // class java/lang/Number
     166: invokevirtual #74                 // Method java/lang/Number.intValue:()I
     169: iconst_1
     170: iadd
     171: istore        15
     173: iinc          12, 1
     176: lload         13
     178: bipush        32
     180: lshr
     181: l2i
     182: istore        16
     184: lload         13
     186: l2i
     187: istore        17
     189: aload         11
     191: iload         15
     193: aload         10
     195: iload         16
     197: iload         17
     199: iand
     200: iload         17
     202: invokestatic  #78                 // Method solve$move:(Ljava/util/Map;ILjava/util/List;II)V
     205: aload         11
     207: iload         15
     209: aload         10
     211: iload         16
     213: iload         17
     215: ior
     216: iload         17
     218: invokestatic  #78                 // Method solve$move:(Ljava/util/Map;ILjava/util/List;II)V
     221: aload         11
     223: iload         15
     225: aload         10
     227: iload         16
     229: iload         17
     231: iload         16
     233: ixor
     234: invokestatic  #78                 // Method solve$move:(Ljava/util/Map;ILjava/util/List;II)V
     237: aload         11
     239: iload         15
     241: aload         10
     243: iload         16
     245: iload         17
     247: iload         5
     249: ixor
     250: invokestatic  #78                 // Method solve$move:(Ljava/util/Map;ILjava/util/List;II)V
     253: goto          102
     256: aload         11
     258: lload         8
     260: invokestatic  #32                 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
     263: invokeinterface #65,  2           // InterfaceMethod java/util/Map.get:(Ljava/lang/Object;)Ljava/lang/Object;
     268: checkcast     #38                 // class java/lang/Integer
     271: dup
     272: ifnull        281
     275: invokevirtual #79                 // Method java/lang/Integer.intValue:()I
     278: goto          283
     281: pop
     282: iconst_m1
     283: istore        13
     285: getstatic     #83                 // Field out:Ljava/io/BufferedWriter;
     288: checkcast     #85                 // class java/lang/Appendable
     291: iload         13
     293: invokestatic  #90                 // Method java/lang/String.valueOf:(I)Ljava/lang/String;
     296: checkcast     #92                 // class java/lang/CharSequence
     299: invokeinterface #96,  2           // InterfaceMethod java/lang/Appendable.append:(Ljava/lang/CharSequence;)Ljava/lang/Appendable;
     304: bipush        10
     306: invokeinterface #99,  2           // InterfaceMethod java/lang/Appendable.append:(C)Ljava/lang/Appendable;
     311: pop
     312: return

  public static final void main();
    Code:
       0: invokestatic  #124                // 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  #126                // Method solve:()V
      18: iinc          1, 1
      21: goto          6
      24: getstatic     #132                // Field kotlin/Unit.INSTANCE:Lkotlin/Unit;
      27: astore_0
      28: aload_0
      29: astore_1
      30: iconst_0
      31: istore_2
      32: getstatic     #83                 // Field out:Ljava/io/BufferedWriter;
      35: invokevirtual #137                // Method java/io/BufferedWriter.close:()V
      38: nop
      39: return

  private static final int readInt();
    Code:
       0: invokestatic  #144                // Method readln:()Ljava/lang/String;
       3: dup
       4: ldc           #146                // String readln(...)
       6: invokestatic  #150                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
       9: invokestatic  #154                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      12: ireturn

  private static final java.util.List<java.lang.String> readStrings();
    Code:
       0: invokestatic  #144                // Method readln:()Ljava/lang/String;
       3: dup
       4: ldc           #146                // String readln(...)
       6: invokestatic  #150                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
       9: checkcast     #92                 // class java/lang/CharSequence
      12: iconst_1
      13: anewarray     #87                 // class java/lang/String
      16: astore_0
      17: aload_0
      18: iconst_0
      19: ldc           #159                // String
      21: aastore
      22: aload_0
      23: iconst_0
      24: iconst_0
      25: bipush        6
      27: aconst_null
      28: invokestatic  #165                // Method kotlin/text/StringsKt.split$default:(Ljava/lang/CharSequence;[Ljava/lang/String;ZIILjava/lang/Object;)Ljava/util/List;
      31: areturn

  private static final java.util.List<java.lang.Integer> readInts();
    Code:
       0: invokestatic  #169                // Method readStrings:()Ljava/util/List;
       3: checkcast     #171                // class java/lang/Iterable
       6: astore_0
       7: iconst_0
       8: istore_1
       9: aload_0
      10: astore_2
      11: new           #16                 // class java/util/ArrayList
      14: dup
      15: aload_0
      16: bipush        10
      18: invokestatic  #177                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      21: invokespecial #180                // Method java/util/ArrayList."<init>":(I)V
      24: checkcast     #182                // class java/util/Collection
      27: astore_3
      28: iconst_0
      29: istore        4
      31: aload_2
      32: invokeinterface #186,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      37: astore        5
      39: aload         5
      41: invokeinterface #192,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      46: ifeq          92
      49: aload         5
      51: invokeinterface #196,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      56: astore        6
      58: aload_3
      59: aload         6
      61: checkcast     #87                 // class java/lang/String
      64: astore        7
      66: astore        9
      68: iconst_0
      69: istore        8
      71: aload         7
      73: invokestatic  #154                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      76: nop
      77: invokestatic  #41                 // 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     #21                 // class java/util/List
      96: nop
      97: areturn

  private static final int[] readIntArray();
    Code:
       0: invokestatic  #144                // Method readln:()Ljava/lang/String;
       3: dup
       4: ldc           #146                // String readln(...)
       6: invokestatic  #150                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
       9: invokestatic  #212                // Method parseIntArray:(Ljava/lang/String;)[I
      12: areturn

  private static final java.util.List<java.lang.Long> readLongs();
    Code:
       0: invokestatic  #169                // Method readStrings:()Ljava/util/List;
       3: checkcast     #171                // class java/lang/Iterable
       6: astore_0
       7: iconst_0
       8: istore_1
       9: aload_0
      10: astore_2
      11: new           #16                 // class java/util/ArrayList
      14: dup
      15: aload_0
      16: bipush        10
      18: invokestatic  #177                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      21: invokespecial #180                // Method java/util/ArrayList."<init>":(I)V
      24: checkcast     #182                // class java/util/Collection
      27: astore_3
      28: iconst_0
      29: istore        4
      31: aload_2
      32: invokeinterface #186,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      37: astore        5
      39: aload         5
      41: invokeinterface #192,  1          // InterfaceMethod java/util/Iterator.hasNext:()Z
      46: ifeq          92
      49: aload         5
      51: invokeinterface #196,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      56: astore        6
      58: aload_3
      59: aload         6
      61: checkcast     #87                 // class java/lang/String
      64: astore        7
      66: astore        9
      68: iconst_0
      69: istore        8
      71: aload         7
      73: invokestatic  #218                // Method java/lang/Long.parseLong:(Ljava/lang/String;)J
      76: nop
      77: invokestatic  #32                 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
      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     #21                 // class java/util/List
      96: nop
      97: areturn

  private static final int[] parseIntArray(java.lang.String);
    Code:
       0: aload_0
       1: checkcast     #92                 // class java/lang/CharSequence
       4: astore_2
       5: iconst_0
       6: istore_3
       7: iconst_0
       8: istore        4
      10: iconst_0
      11: istore        5
      13: iload         5
      15: aload_2
      16: invokeinterface #222,  1          // InterfaceMethod java/lang/CharSequence.length:()I
      21: if_icmpge     65
      24: aload_2
      25: iload         5
      27: invokeinterface #226,  2          // InterfaceMethod java/lang/CharSequence.charAt:(I)C
      32: istore        6
      34: iload         6
      36: istore        7
      38: iconst_0
      39: istore        8
      41: iload         7
      43: bipush        32
      45: if_icmpne     52
      48: iconst_1
      49: goto          53
      52: iconst_0
      53: ifeq          59
      56: iinc          4, 1
      59: iinc          5, 1
      62: goto          13
      65: iload         4
      67: iconst_1
      68: iadd
      69: newarray       int
      71: astore_1
      72: iconst_0
      73: istore_2
      74: iconst_0
      75: istore_3
      76: iconst_0
      77: istore        4
      79: aload_0
      80: invokevirtual #227                // Method java/lang/String.length:()I
      83: istore        5
      85: iload         4
      87: iload         5
      89: if_icmpge     136
      92: aload_0
      93: iload         4
      95: invokevirtual #228                // Method java/lang/String.charAt:(I)C
      98: istore        6
     100: iload         6
     102: bipush        32
     104: if_icmpeq     121
     107: iload_3
     108: bipush        10
     110: imul
     111: iload         6
     113: iadd
     114: bipush        48
     116: isub
     117: istore_3
     118: goto          130
     121: aload_1
     122: iload_2
     123: iinc          2, 1
     126: iload_3
     127: iastore
     128: iconst_0
     129: istore_3
     130: iinc          4, 1
     133: goto          85
     136: aload_1
     137: iload_2
     138: iload_3
     139: iastore
     140: aload_1
     141: areturn

  private static final java.lang.String readln();
    Code:
       0: getstatic     #243                // Field in:Ljava/io/BufferedReader;
       3: invokevirtual #248                // Method java/io/BufferedReader.readLine:()Ljava/lang/String;
       6: areturn

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

  private static final long solve$encode(int, int);
    Code:
       0: iload_0
       1: i2l
       2: bipush        32
       4: lshl
       5: iload_1
       6: i2l
       7: lor
       8: lreturn

  private static final void solve$move(java.util.Map<java.lang.Long, java.lang.Integer>, int, java.util.List<java.lang.Long>, int, int);
    Code:
       0: iload_3
       1: iload         4
       3: invokestatic  #14                 // Method solve$encode:(II)J
       6: lstore        5
       8: lload         5
      10: invokestatic  #32                 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
      13: aload_0
      14: swap
      15: invokeinterface #52,  2           // InterfaceMethod java/util/Map.containsKey:(Ljava/lang/Object;)Z
      20: ifeq          24
      23: return
      24: lload         5
      26: invokestatic  #32                 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
      29: astore        7
      31: iload_1
      32: invokestatic  #41                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      35: astore        8
      37: aload_0
      38: aload         7
      40: aload         8
      42: invokeinterface #45,  3           // InterfaceMethod java/util/Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
      47: pop
      48: aload_2
      49: lload         5
      51: invokestatic  #32                 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
      54: invokeinterface #36,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
      59: pop
      60: return

  static {};
    Code:
       0: getstatic     #263                // Field java/lang/System.in:Ljava/io/InputStream;
       3: dup
       4: ldc_w         #264                // String in
       7: invokestatic  #150                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      10: astore_0
      11: getstatic     #270                // Field kotlin/text/Charsets.UTF_8:Ljava/nio/charset/Charset;
      14: astore_1
      15: new           #272                // class java/io/InputStreamReader
      18: dup
      19: aload_0
      20: aload_1
      21: invokespecial #275                // Method java/io/InputStreamReader."<init>":(Ljava/io/InputStream;Ljava/nio/charset/Charset;)V
      24: checkcast     #277                // class java/io/Reader
      27: astore_2
      28: sipush        8192
      31: istore_3
      32: aload_2
      33: instanceof    #245                // class java/io/BufferedReader
      36: ifeq          46
      39: aload_2
      40: checkcast     #245                // class java/io/BufferedReader
      43: goto          55
      46: new           #245                // class java/io/BufferedReader
      49: dup
      50: aload_2
      51: iload_3
      52: invokespecial #280                // Method java/io/BufferedReader."<init>":(Ljava/io/Reader;I)V
      55: putstatic     #243                // Field in:Ljava/io/BufferedReader;
      58: getstatic     #283                // Field java/lang/System.out:Ljava/io/PrintStream;
      61: dup
      62: ldc_w         #284                // String out
      65: invokestatic  #150                // Method kotlin/jvm/internal/Intrinsics.checkNotNullExpressionValue:(Ljava/lang/Object;Ljava/lang/String;)V
      68: checkcast     #286                // class java/io/OutputStream
      71: astore_0
      72: getstatic     #270                // Field kotlin/text/Charsets.UTF_8:Ljava/nio/charset/Charset;
      75: astore_1
      76: new           #288                // class java/io/OutputStreamWriter
      79: dup
      80: aload_0
      81: aload_1
      82: invokespecial #291                // Method java/io/OutputStreamWriter."<init>":(Ljava/io/OutputStream;Ljava/nio/charset/Charset;)V
      85: checkcast     #293                // class java/io/Writer
      88: astore_2
      89: sipush        8192
      92: istore_3
      93: aload_2
      94: instanceof    #134                // class java/io/BufferedWriter
      97: ifeq          107
     100: aload_2
     101: checkcast     #134                // class java/io/BufferedWriter
     104: goto          116
     107: new           #134                // class java/io/BufferedWriter
     110: dup
     111: aload_2
     112: iload_3
     113: invokespecial #296                // Method java/io/BufferedWriter."<init>":(Ljava/io/Writer;I)V
     116: putstatic     #83                 // Field out:Ljava/io/BufferedWriter;
     119: return
}


package codeforces.round901

private fun precalc(n: Int = 5000): List<DoubleArray> {
	val p = List(n + 1) { DoubleArray(it) }
	for (i in 1..n) {
		p[i][0] = 1.0 / i
		for (j in 1 until i) {
			if (j >= 2) p[i][j] = (j - 1.0) / i * p[i - 2][j - 2]
			if (j < i - 1) p[i][j] += (i - j - 1.0) / i * p[i - 2][j - 1]
		}
	}
	return p
}

private val precalc = precalc()

private fun solve(): Double {
	val (n, m) = readInts()
	val nei = List(n) { mutableListOf<Int>() }
	repeat(m) {
		val (a, b) = readInts().map { it - 1 }
		nei[a].add(b)
	}

	val p = DoubleArray(n)
	p[n - 1] = 1.0
	for (i in n - 2 downTo 0) {
		val ps = nei[i].map { p[it] }.sortedDescending()
		p[i] = ps.indices.sumOf { j -> ps[j] * precalc[ps.size][j] }
	}
	return p[0]
}

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

private fun readInt() = readln().toInt()
private fun readStrings() = readln().split(" ")
private fun readInts() = readStrings().map { it.toInt() }

Compiled from "c.kt"
public final class codeforces.round901.CKt {
  private static final java.util.List<double[]> precalc;

  private static final java.util.List<double[]> precalc(int);
    Code:
       0: iload_0
       1: iconst_1
       2: iadd
       3: istore_2
       4: new           #9                  // class java/util/ArrayList
       7: dup
       8: iload_2
       9: invokespecial #13                 // Method java/util/ArrayList."<init>":(I)V
      12: astore_3
      13: iconst_0
      14: istore        4
      16: iload         4
      18: iload_2
      19: if_icmpge     53
      22: iload         4
      24: istore        5
      26: aload_3
      27: iload         5
      29: istore        6
      31: astore        8
      33: iconst_0
      34: istore        7
      36: iload         6
      38: newarray       double
      40: aload         8
      42: swap
      43: invokevirtual #17                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
      46: pop
      47: iinc          4, 1
      50: goto          16
      53: aload_3
      54: checkcast     #19                 // class java/util/List
      57: astore_1
      58: iconst_1
      59: istore_2
      60: iload_2
      61: iload_0
      62: if_icmpgt     205
      65: aload_1
      66: iload_2
      67: invokeinterface #23,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      72: checkcast     #25                 // class "[D"
      75: iconst_0
      76: dconst_1
      77: iload_2
      78: i2d
      79: ddiv
      80: dastore
      81: iconst_1
      82: istore_3
      83: iload_3
      84: iload_2
      85: if_icmpge     194
      88: iload_3
      89: iconst_2
      90: if_icmplt     129
      93: aload_1
      94: iload_2
      95: invokeinterface #23,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     100: checkcast     #25                 // class "[D"
     103: iload_3
     104: iload_3
     105: i2d
     106: dconst_1
     107: dsub
     108: iload_2
     109: i2d
     110: ddiv
     111: aload_1
     112: iload_2
     113: iconst_2
     114: isub
     115: invokeinterface #23,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     120: checkcast     #25                 // class "[D"
     123: iload_3
     124: iconst_2
     125: isub
     126: daload
     127: dmul
     128: dastore
     129: iload_3
     130: iload_2
     131: iconst_1
     132: isub
     133: if_icmpge     188
     136: aload_1
     137: iload_2
     138: invokeinterface #23,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     143: checkcast     #25                 // class "[D"
     146: astore        4
     148: iload_3
     149: istore        5
     151: aload         4
     153: iload         5
     155: aload         4
     157: iload         5
     159: daload
     160: iload_2
     161: iload_3
     162: isub
     163: i2d
     164: dconst_1
     165: dsub
     166: iload_2
     167: i2d
     168: ddiv
     169: aload_1
     170: iload_2
     171: iconst_2
     172: isub
     173: invokeinterface #23,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     178: checkcast     #25                 // class "[D"
     181: iload_3
     182: iconst_1
     183: isub
     184: daload
     185: dmul
     186: dadd
     187: dastore
     188: iinc          3, 1
     191: goto          83
     194: iload_2
     195: iload_0
     196: if_icmpeq     205
     199: iinc          2, 1
     202: goto          65
     205: aload_1
     206: areturn

  static java.util.List precalc$default(int, int, java.lang.Object);
    Code:
       0: iload_1
       1: iconst_1
       2: iand
       3: ifeq          10
       6: sipush        5000
       9: istore_0
      10: iload_0
      11: invokestatic  #37                 // Method precalc:(I)Ljava/util/List;
      14: areturn

  private static final double solve();
    Code:
       0: invokestatic  #43                 // Method readInts:()Ljava/util/List;
       3: astore_0
       4: aload_0
       5: iconst_0
       6: invokeinterface #23,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      11: checkcast     #45                 // class java/lang/Number
      14: invokevirtual #49                 // Method java/lang/Number.intValue:()I
      17: istore_1
      18: aload_0
      19: iconst_1
      20: invokeinterface #23,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      25: checkcast     #45                 // class java/lang/Number
      28: invokevirtual #49                 // Method java/lang/Number.intValue:()I
      31: istore_2
      32: new           #9                  // class java/util/ArrayList
      35: dup
      36: iload_1
      37: invokespecial #13                 // 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     90
      51: iload         5
      53: istore        6
      55: aload         4
      57: iload         6
      59: istore        7
      61: astore        18
      63: iconst_0
      64: istore        8
      66: new           #9                  // class java/util/ArrayList
      69: dup
      70: invokespecial #52                 // Method java/util/ArrayList."<init>":()V
      73: checkcast     #19                 // class java/util/List
      76: nop
      77: aload         18
      79: swap
      80: invokevirtual #17                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
      83: pop
      84: iinc          5, 1
      87: goto          45
      90: aload         4
      92: checkcast     #19                 // class java/util/List
      95: astore_3
      96: iconst_0
      97: istore        4
      99: iload         4
     101: iload_2
     102: if_icmpge     282
     105: iload         4
     107: istore        5
     109: iconst_0
     110: istore        6
     112: invokestatic  #43                 // Method readInts:()Ljava/util/List;
     115: checkcast     #54                 // class java/lang/Iterable
     118: astore        7
     120: iconst_0
     121: istore        8
     123: aload         7
     125: astore        9
     127: new           #9                  // class java/util/ArrayList
     130: dup
     131: aload         7
     133: bipush        10
     135: invokestatic  #60                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     138: invokespecial #13                 // Method java/util/ArrayList."<init>":(I)V
     141: checkcast     #62                 // class java/util/Collection
     144: astore        10
     146: iconst_0
     147: istore        11
     149: aload         9
     151: invokeinterface #66,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     156: astore        12
     158: aload         12
     160: invokeinterface #72,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     165: ifeq          213
     168: aload         12
     170: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     175: astore        13
     177: aload         10
     179: aload         13
     181: checkcast     #45                 // class java/lang/Number
     184: invokevirtual #49                 // Method java/lang/Number.intValue:()I
     187: istore        14
     189: astore        15
     191: iconst_0
     192: istore        16
     194: iload         14
     196: iconst_1
     197: isub
     198: invokestatic  #82                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     201: aload         15
     203: swap
     204: invokeinterface #83,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     209: pop
     210: goto          158
     213: aload         10
     215: checkcast     #19                 // class java/util/List
     218: nop
     219: astore        17
     221: aload         17
     223: iconst_0
     224: invokeinterface #23,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     229: checkcast     #45                 // class java/lang/Number
     232: invokevirtual #49                 // Method java/lang/Number.intValue:()I
     235: istore        7
     237: aload         17
     239: iconst_1
     240: invokeinterface #23,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     245: checkcast     #45                 // class java/lang/Number
     248: invokevirtual #49                 // Method java/lang/Number.intValue:()I
     251: istore        8
     253: aload_3
     254: iload         7
     256: invokeinterface #23,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     261: checkcast     #19                 // class java/util/List
     264: iload         8
     266: invokestatic  #82                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
     269: invokeinterface #84,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     274: pop
     275: nop
     276: iinc          4, 1
     279: goto          99
     282: iload_1
     283: newarray       double
     285: astore        4
     287: aload         4
     289: iload_1
     290: iconst_1
     291: isub
     292: dconst_1
     293: dastore
     294: iload_1
     295: iconst_2
     296: isub
     297: istore        5
     299: iconst_m1
     300: iload         5
     302: if_icmpge     556
     305: aload_3
     306: iload         5
     308: invokeinterface #23,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     313: checkcast     #54                 // class java/lang/Iterable
     316: astore        7
     318: iconst_0
     319: istore        8
     321: aload         7
     323: astore        9
     325: new           #9                  // class java/util/ArrayList
     328: dup
     329: aload         7
     331: bipush        10
     333: invokestatic  #60                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
     336: invokespecial #13                 // Method java/util/ArrayList."<init>":(I)V
     339: checkcast     #62                 // class java/util/Collection
     342: astore        10
     344: iconst_0
     345: istore        11
     347: aload         9
     349: invokeinterface #66,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     354: astore        12
     356: aload         12
     358: invokeinterface #72,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     363: ifeq          412
     366: aload         12
     368: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     373: astore        13
     375: aload         10
     377: aload         13
     379: checkcast     #45                 // class java/lang/Number
     382: invokevirtual #49                 // Method java/lang/Number.intValue:()I
     385: istore        14
     387: astore        18
     389: iconst_0
     390: istore        15
     392: aload         4
     394: iload         14
     396: daload
     397: invokestatic  #89                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
     400: aload         18
     402: swap
     403: invokeinterface #83,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
     408: pop
     409: goto          356
     412: aload         10
     414: checkcast     #19                 // class java/util/List
     417: nop
     418: checkcast     #54                 // class java/lang/Iterable
     421: invokestatic  #93                 // Method kotlin/collections/CollectionsKt.sortedDescending:(Ljava/lang/Iterable;)Ljava/util/List;
     424: astore        6
     426: aload         4
     428: iload         5
     430: aload         6
     432: checkcast     #62                 // class java/util/Collection
     435: invokestatic  #97                 // Method kotlin/collections/CollectionsKt.getIndices:(Ljava/util/Collection;)Lkotlin/ranges/IntRange;
     438: checkcast     #54                 // class java/lang/Iterable
     441: astore        7
     443: istore        19
     445: astore        18
     447: dconst_0
     448: dstore        8
     450: aload         7
     452: invokeinterface #66,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     457: astore        10
     459: aload         10
     461: invokeinterface #72,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     466: ifeq          539
     469: aload         10
     471: checkcast     #99                 // class kotlin/collections/IntIterator
     474: invokevirtual #102                // Method kotlin/collections/IntIterator.nextInt:()I
     477: istore        11
     479: dload         8
     481: iload         11
     483: istore        12
     485: dstore        20
     487: iconst_0
     488: istore        13
     490: aload         6
     492: iload         12
     494: invokeinterface #23,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     499: checkcast     #45                 // class java/lang/Number
     502: invokevirtual #105                // Method java/lang/Number.doubleValue:()D
     505: getstatic     #107                // Field precalc:Ljava/util/List;
     508: aload         6
     510: invokeinterface #110,  1          // InterfaceMethod java/util/List.size:()I
     515: invokeinterface #23,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     520: checkcast     #25                 // class "[D"
     523: iload         12
     525: daload
     526: dmul
     527: dstore        22
     529: dload         20
     531: dload         22
     533: dadd
     534: dstore        8
     536: goto          459
     539: dload         8
     541: dstore        20
     543: aload         18
     545: iload         19
     547: dload         20
     549: dastore
     550: iinc          5, -1
     553: goto          299
     556: aload         4
     558: iconst_0
     559: daload
     560: dreturn

  public static final void main();
    Code:
       0: invokestatic  #133                // Method readInt:()I
       3: istore_0
       4: iconst_0
       5: istore_1
       6: iload_1
       7: iload_0
       8: if_icmpge     35
      11: iload_1
      12: istore_2
      13: iconst_0
      14: istore_3
      15: invokestatic  #135                // Method solve:()D
      18: dstore        4
      20: getstatic     #141                // Field java/lang/System.out:Ljava/io/PrintStream;
      23: dload         4
      25: invokevirtual #147                // Method java/io/PrintStream.println:(D)V
      28: nop
      29: iinc          1, 1
      32: goto          6
      35: return

  private static final int readInt();
    Code:
       0: invokestatic  #154                // Method kotlin/io/ConsoleKt.readln:()Ljava/lang/String;
       3: invokestatic  #158                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
       6: ireturn

  private static final java.util.List<java.lang.String> readStrings();
    Code:
       0: invokestatic  #154                // Method kotlin/io/ConsoleKt.readln:()Ljava/lang/String;
       3: checkcast     #162                // class java/lang/CharSequence
       6: iconst_1
       7: anewarray     #164                // class java/lang/String
      10: astore_0
      11: aload_0
      12: iconst_0
      13: ldc           #166                // String
      15: aastore
      16: aload_0
      17: iconst_0
      18: iconst_0
      19: bipush        6
      21: aconst_null
      22: invokestatic  #172                // 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  #175                // Method readStrings:()Ljava/util/List;
       3: checkcast     #54                 // class java/lang/Iterable
       6: astore_0
       7: iconst_0
       8: istore_1
       9: aload_0
      10: astore_2
      11: new           #9                  // class java/util/ArrayList
      14: dup
      15: aload_0
      16: bipush        10
      18: invokestatic  #60                 // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      21: invokespecial #13                 // Method java/util/ArrayList."<init>":(I)V
      24: checkcast     #62                 // class java/util/Collection
      27: astore_3
      28: iconst_0
      29: istore        4
      31: aload_2
      32: invokeinterface #66,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      37: astore        5
      39: aload         5
      41: invokeinterface #72,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      46: ifeq          92
      49: aload         5
      51: invokeinterface #76,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      56: astore        6
      58: aload_3
      59: aload         6
      61: checkcast     #164                // class java/lang/String
      64: astore        7
      66: astore        9
      68: iconst_0
      69: istore        8
      71: aload         7
      73: invokestatic  #158                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      76: nop
      77: invokestatic  #82                 // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      80: aload         9
      82: swap
      83: invokeinterface #83,  2           // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      88: pop
      89: goto          39
      92: aload_3
      93: checkcast     #19                 // class java/util/List
      96: nop
      97: areturn

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

  static {};
    Code:
       0: iconst_0
       1: iconst_1
       2: aconst_null
       3: invokestatic  #185                // Method precalc$default:(IILjava/lang/Object;)Ljava/util/List;
       6: putstatic     #107                // Field precalc:Ljava/util/List;
       9: return
}


package codeforces.round901

private fun solve(): Long {
	val (_, _, k) = readInts()
	val (a, b) = List(2) { readInts().toMutableList() }
	val moves = mutableListOf<Long>()
	var i = 0
	while (i < k) {
		val move = if (i % 2 == 0) makeMove(a, b) else makeMove(b, a)
		moves.add(move)
		if (i >= 4 && moves[moves.size - 1] == moves[moves.size - 3] && moves[moves.size - 2] == moves[moves.size - 4]) {
			i += maxOf((k - 1 - i) / 2 * 2, 0)
		}
		i++
	}
	return a.sumOf { it.toLong() }
}

private fun makeMove(a: MutableList<Int>, b: MutableList<Int>): Long {
	val aMin = a.min()
	val bMax = b.max()
	if (aMin >= bMax) return 0
	a.remove(aMin); a.add(bMax)
	b.add(aMin); b.remove(bMax)
	return aMin with bMax
}

private infix fun Int.with(that: Int) = (toLong() shl 32) or that.toLong()

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

private fun readInt() = readln().toInt()
private fun readStrings() = readln().split(" ")
private fun readInts() = readStrings().map { it.toInt() }

Compiled from "a.kt"
public final class codeforces.round901.AKt {
  private static final long solve();
    Code:
       0: invokestatic  #10                 // Method readInts:()Ljava/util/List;
       3: iconst_2
       4: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
       9: checkcast     #18                 // class java/lang/Number
      12: invokevirtual #22                 // Method java/lang/Number.intValue:()I
      15: istore_0
      16: iconst_2
      17: istore_2
      18: new           #24                 // class java/util/ArrayList
      21: dup
      22: iload_2
      23: invokespecial #28                 // Method java/util/ArrayList."<init>":(I)V
      26: astore_3
      27: iconst_0
      28: istore        4
      30: iload         4
      32: iload_2
      33: if_icmpge     72
      36: iload         4
      38: istore        5
      40: aload_3
      41: iload         5
      43: istore        6
      45: astore        13
      47: iconst_0
      48: istore        7
      50: invokestatic  #10                 // Method readInts:()Ljava/util/List;
      53: checkcast     #30                 // class java/util/Collection
      56: invokestatic  #36                 // Method kotlin/collections/CollectionsKt.toMutableList:(Ljava/util/Collection;)Ljava/util/List;
      59: aload         13
      61: swap
      62: invokevirtual #40                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
      65: pop
      66: iinc          4, 1
      69: goto          30
      72: aload_3
      73: checkcast     #12                 // class java/util/List
      76: astore_1
      77: aload_1
      78: iconst_0
      79: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      84: checkcast     #12                 // class java/util/List
      87: astore_2
      88: aload_1
      89: iconst_1
      90: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      95: checkcast     #12                 // class java/util/List
      98: astore_3
      99: new           #24                 // class java/util/ArrayList
     102: dup
     103: invokespecial #43                 // Method java/util/ArrayList."<init>":()V
     106: checkcast     #12                 // class java/util/List
     109: astore        4
     111: iconst_0
     112: istore        5
     114: iload         5
     116: iload_0
     117: if_icmpge     282
     120: iload         5
     122: iconst_2
     123: irem
     124: ifne          135
     127: aload_2
     128: aload_3
     129: invokestatic  #47                 // Method makeMove:(Ljava/util/List;Ljava/util/List;)J
     132: goto          140
     135: aload_3
     136: aload_2
     137: invokestatic  #47                 // Method makeMove:(Ljava/util/List;Ljava/util/List;)J
     140: lstore        6
     142: aload         4
     144: lload         6
     146: invokestatic  #53                 // Method java/lang/Long.valueOf:(J)Ljava/lang/Long;
     149: invokeinterface #54,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
     154: pop
     155: iload         5
     157: iconst_4
     158: if_icmplt     276
     161: aload         4
     163: aload         4
     165: invokeinterface #57,  1           // InterfaceMethod java/util/List.size:()I
     170: iconst_1
     171: isub
     172: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     177: checkcast     #18                 // class java/lang/Number
     180: invokevirtual #60                 // Method java/lang/Number.longValue:()J
     183: aload         4
     185: aload         4
     187: invokeinterface #57,  1           // InterfaceMethod java/util/List.size:()I
     192: iconst_3
     193: isub
     194: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     199: checkcast     #18                 // class java/lang/Number
     202: invokevirtual #60                 // Method java/lang/Number.longValue:()J
     205: lcmp
     206: ifne          276
     209: aload         4
     211: aload         4
     213: invokeinterface #57,  1           // InterfaceMethod java/util/List.size:()I
     218: iconst_2
     219: isub
     220: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     225: checkcast     #18                 // class java/lang/Number
     228: invokevirtual #60                 // Method java/lang/Number.longValue:()J
     231: aload         4
     233: aload         4
     235: invokeinterface #57,  1           // InterfaceMethod java/util/List.size:()I
     240: iconst_4
     241: isub
     242: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     247: checkcast     #18                 // class java/lang/Number
     250: invokevirtual #60                 // Method java/lang/Number.longValue:()J
     253: lcmp
     254: ifne          276
     257: iload         5
     259: iload_0
     260: iconst_1
     261: isub
     262: iload         5
     264: isub
     265: iconst_2
     266: idiv
     267: iconst_2
     268: imul
     269: iconst_0
     270: invokestatic  #66                 // Method java/lang/Math.max:(II)I
     273: iadd
     274: istore        5
     276: iinc          5, 1
     279: goto          114
     282: aload_2
     283: checkcast     #68                 // class java/lang/Iterable
     286: astore        6
     288: lconst_0
     289: lstore        7
     291: aload         6
     293: invokeinterface #72,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
     298: astore        9
     300: aload         9
     302: invokeinterface #78,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     307: ifeq          351
     310: aload         9
     312: invokeinterface #82,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     317: astore        10
     319: lload         7
     321: aload         10
     323: checkcast     #18                 // class java/lang/Number
     326: invokevirtual #22                 // Method java/lang/Number.intValue:()I
     329: istore        11
     331: lstore        13
     333: iconst_0
     334: istore        12
     336: iload         11
     338: i2l
     339: lstore        15
     341: lload         13
     343: lload         15
     345: ladd
     346: lstore        7
     348: goto          300
     351: lload         7
     353: lreturn

  private static final long makeMove(java.util.List<java.lang.Integer>, java.util.List<java.lang.Integer>);
    Code:
       0: aload_0
       1: checkcast     #68                 // class java/lang/Iterable
       4: invokestatic  #99                 // Method kotlin/collections/CollectionsKt.minOrThrow:(Ljava/lang/Iterable;)Ljava/lang/Comparable;
       7: checkcast     #18                 // class java/lang/Number
      10: invokevirtual #22                 // Method java/lang/Number.intValue:()I
      13: istore_2
      14: aload_1
      15: checkcast     #68                 // class java/lang/Iterable
      18: invokestatic  #102                // Method kotlin/collections/CollectionsKt.maxOrThrow:(Ljava/lang/Iterable;)Ljava/lang/Comparable;
      21: checkcast     #18                 // class java/lang/Number
      24: invokevirtual #22                 // Method java/lang/Number.intValue:()I
      27: istore_3
      28: iload_2
      29: iload_3
      30: if_icmplt     35
      33: lconst_0
      34: lreturn
      35: aload_0
      36: iload_2
      37: invokestatic  #107                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      40: invokeinterface #110,  2          // InterfaceMethod java/util/List.remove:(Ljava/lang/Object;)Z
      45: pop
      46: aload_0
      47: iload_3
      48: invokestatic  #107                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      51: invokeinterface #54,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
      56: pop
      57: aload_1
      58: iload_2
      59: invokestatic  #107                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      62: invokeinterface #54,  2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
      67: pop
      68: aload_1
      69: iload_3
      70: invokestatic  #107                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      73: invokeinterface #110,  2          // InterfaceMethod java/util/List.remove:(Ljava/lang/Object;)Z
      78: pop
      79: iload_2
      80: iload_3
      81: invokestatic  #114                // Method with:(II)J
      84: lreturn

  private static final long with(int, int);
    Code:
       0: iload_0
       1: i2l
       2: bipush        32
       4: lshl
       5: iload_1
       6: i2l
       7: lor
       8: lreturn

  public static final void main();
    Code:
       0: invokestatic  #122                // Method readInt:()I
       3: istore_0
       4: iconst_0
       5: istore_1
       6: iload_1
       7: iload_0
       8: if_icmpge     35
      11: iload_1
      12: istore_2
      13: iconst_0
      14: istore_3
      15: invokestatic  #124                // Method solve:()J
      18: lstore        4
      20: getstatic     #130                // Field java/lang/System.out:Ljava/io/PrintStream;
      23: lload         4
      25: invokevirtual #136                // Method java/io/PrintStream.println:(J)V
      28: nop
      29: iinc          1, 1
      32: goto          6
      35: return

  private static final int readInt();
    Code:
       0: invokestatic  #143                // Method kotlin/io/ConsoleKt.readln:()Ljava/lang/String;
       3: invokestatic  #147                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
       6: ireturn

  private static final java.util.List<java.lang.String> readStrings();
    Code:
       0: invokestatic  #143                // Method kotlin/io/ConsoleKt.readln:()Ljava/lang/String;
       3: checkcast     #151                // class java/lang/CharSequence
       6: iconst_1
       7: anewarray     #153                // class java/lang/String
      10: astore_0
      11: aload_0
      12: iconst_0
      13: ldc           #155                // String
      15: aastore
      16: aload_0
      17: iconst_0
      18: iconst_0
      19: bipush        6
      21: aconst_null
      22: invokestatic  #161                // 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  #164                // Method readStrings:()Ljava/util/List;
       3: checkcast     #68                 // 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  #168                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      21: invokespecial #28                 // Method java/util/ArrayList."<init>":(I)V
      24: checkcast     #30                 // class java/util/Collection
      27: astore_3
      28: iconst_0
      29: istore        4
      31: aload_2
      32: invokeinterface #72,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      37: astore        5
      39: aload         5
      41: invokeinterface #78,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      46: ifeq          92
      49: aload         5
      51: invokeinterface #82,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      56: astore        6
      58: aload_3
      59: aload         6
      61: checkcast     #153                // class java/lang/String
      64: astore        7
      66: astore        9
      68: iconst_0
      69: istore        8
      71: aload         7
      73: invokestatic  #147                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      76: nop
      77: invokestatic  #107                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      80: aload         9
      82: swap
      83: invokeinterface #169,  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  #183                // Method main:()V
       3: return
}


package codeforces.round901

private fun solve(): Double {
	val (n, m) = readInts()
	val d = List(n + 1) { DoubleArray(m - n + 1) }
	for (i in 1..n) {
		var kPrevBest = 0
		for (s in d[i].indices) {
			val range = maxOf(kPrevBest - 56, 0)..minOf(kPrevBest + 1, s)
			val (kBest, best) = range.minByAndValue { k -> (i + s - 1.0 - k) / (1 + k) + d[i - 1][s - k] }
			d[i][s] = best
			kPrevBest = kBest
		}
	}
	return d[n][m - n] * 2 + n
}

private inline fun <T, R : Comparable<R>> Iterable<T>.minByAndValue(crossinline selector: (T) -> R) = asSequence().map { it to selector(it) }.minBy { it.second }

fun main() = repeat(1) { println(solve()) }

private fun readStrings() = readln().split(" ")
private fun readInts() = readStrings().map { it.toInt() }

Compiled from "d.kt"
public final class codeforces.round901.DKt$solve$$inlined$minByAndValue$1 implements kotlin.jvm.functions.Function1<java.lang.Integer, kotlin.Pair<? extends java.lang.Integer, ? extends java.lang.Double>> {
  final int $i$inlined;

  final int $s$inlined;

  final java.util.List $d$inlined;

  public codeforces.round901.DKt$solve$$inlined$minByAndValue$1(int, int, java.util.List);
    Code:
       0: aload_0
       1: iload_1
       2: putfield      #21                 // Field $i$inlined:I
       5: aload_0
       6: iload_2
       7: putfield      #23                 // Field $s$inlined:I
      10: aload_0
      11: aload_3
      12: putfield      #25                 // Field $d$inlined:Ljava/util/List;
      15: aload_0
      16: invokespecial #28                 // Method java/lang/Object."<init>":()V
      19: return

  public final kotlin.Pair<java.lang.Integer, java.lang.Double> invoke(java.lang.Integer);
    Code:
       0: aload_1
       1: aload_1
       2: checkcast     #35                 // class java/lang/Number
       5: invokevirtual #39                 // Method java/lang/Number.intValue:()I
       8: istore_2
       9: astore        4
      11: iconst_0
      12: istore_3
      13: aload_0
      14: getfield      #21                 // Field $i$inlined:I
      17: aload_0
      18: getfield      #23                 // Field $s$inlined:I
      21: iadd
      22: i2d
      23: dconst_1
      24: dsub
      25: iload_2
      26: i2d
      27: dsub
      28: iconst_1
      29: iload_2
      30: iadd
      31: i2d
      32: ddiv
      33: aload_0
      34: getfield      #25                 // Field $d$inlined:Ljava/util/List;
      37: aload_0
      38: getfield      #21                 // Field $i$inlined:I
      41: iconst_1
      42: isub
      43: invokeinterface #45,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      48: checkcast     #47                 // class "[D"
      51: aload_0
      52: getfield      #23                 // Field $s$inlined:I
      55: iload_2
      56: isub
      57: daload
      58: dadd
      59: invokestatic  #53                 // Method java/lang/Double.valueOf:(D)Ljava/lang/Double;
      62: aload         4
      64: swap
      65: invokestatic  #59                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      68: areturn

  public java.lang.Object invoke(java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: invokevirtual #66                 // Method invoke:(Ljava/lang/Object;)Lkotlin/Pair;
       5: areturn
}

Compiled from "d.kt"
public final class codeforces.round901.DKt {
  private static final double solve();
    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: iload_1
      33: iconst_1
      34: iadd
      35: istore        4
      37: new           #24                 // class java/util/ArrayList
      40: dup
      41: iload         4
      43: invokespecial #28                 // Method java/util/ArrayList."<init>":(I)V
      46: astore        5
      48: iconst_0
      49: istore        6
      51: iload         6
      53: iload         4
      55: if_icmpge     93
      58: iload         6
      60: istore        7
      62: aload         5
      64: iload         7
      66: istore        8
      68: astore        20
      70: iconst_0
      71: istore        9
      73: iload_2
      74: iload_1
      75: isub
      76: iconst_1
      77: iadd
      78: newarray       double
      80: aload         20
      82: swap
      83: invokevirtual #32                 // Method java/util/ArrayList.add:(Ljava/lang/Object;)Z
      86: pop
      87: iinc          6, 1
      90: goto          51
      93: aload         5
      95: checkcast     #12                 // class java/util/List
      98: astore_3
      99: iconst_1
     100: istore        4
     102: iload         4
     104: iload_1
     105: if_icmpgt     402
     108: iconst_0
     109: istore        5
     111: iconst_0
     112: istore        6
     114: aload_3
     115: iload         4
     117: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     122: checkcast     #34                 // class "[D"
     125: arraylength
     126: istore        7
     128: iload         6
     130: iload         7
     132: if_icmpge     390
     135: new           #36                 // class kotlin/ranges/IntRange
     138: dup
     139: iload         5
     141: bipush        56
     143: isub
     144: iconst_0
     145: invokestatic  #42                 // Method java/lang/Math.max:(II)I
     148: iload         5
     150: iconst_1
     151: iadd
     152: iload         6
     154: invokestatic  #45                 // Method java/lang/Math.min:(II)I
     157: invokespecial #48                 // Method kotlin/ranges/IntRange."<init>":(II)V
     160: astore        8
     162: aload         8
     164: checkcast     #50                 // class java/lang/Iterable
     167: astore        10
     169: iconst_0
     170: istore        11
     172: aload         10
     174: invokestatic  #56                 // Method kotlin/collections/CollectionsKt.asSequence:(Ljava/lang/Iterable;)Lkotlin/sequences/Sequence;
     177: new           #58                 // class codeforces/round901/DKt$solve$$inlined$minByAndValue$1
     180: dup
     181: iload         4
     183: iload         6
     185: aload_3
     186: invokespecial #61                 // Method codeforces/round901/DKt$solve$$inlined$minByAndValue$1."<init>":(IILjava/util/List;)V
     189: checkcast     #63                 // class kotlin/jvm/functions/Function1
     192: invokestatic  #69                 // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
     195: astore        12
     197: iconst_0
     198: istore        13
     200: aload         12
     202: invokeinterface #75,  1           // InterfaceMethod kotlin/sequences/Sequence.iterator:()Ljava/util/Iterator;
     207: astore        14
     209: aload         14
     211: invokeinterface #81,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     216: ifne          227
     219: new           #83                 // class java/util/NoSuchElementException
     222: dup
     223: invokespecial #86                 // Method java/util/NoSuchElementException."<init>":()V
     226: athrow
     227: aload         14
     229: invokeinterface #90,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     234: astore        15
     236: aload         14
     238: invokeinterface #81,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     243: ifne          251
     246: aload         15
     248: goto          332
     251: aload         15
     253: checkcast     #92                 // class kotlin/Pair
     256: astore        16
     258: iconst_0
     259: istore        17
     261: aload         16
     263: invokevirtual #95                 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     266: checkcast     #97                 // class java/lang/Comparable
     269: astore        16
     271: aload         14
     273: invokeinterface #90,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     278: astore        17
     280: aload         17
     282: checkcast     #92                 // class kotlin/Pair
     285: astore        18
     287: iconst_0
     288: istore        19
     290: aload         18
     292: invokevirtual #95                 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     295: checkcast     #97                 // class java/lang/Comparable
     298: astore        18
     300: aload         16
     302: aload         18
     304: invokeinterface #101,  2          // InterfaceMethod java/lang/Comparable.compareTo:(Ljava/lang/Object;)I
     309: ifle          320
     312: aload         17
     314: astore        15
     316: aload         18
     318: astore        16
     320: aload         14
     322: invokeinterface #81,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     327: ifne          271
     330: aload         15
     332: checkcast     #92                 // class kotlin/Pair
     335: nop
     336: astore        9
     338: aload         9
     340: invokevirtual #104                // Method kotlin/Pair.component1:()Ljava/lang/Object;
     343: checkcast     #18                 // class java/lang/Number
     346: invokevirtual #22                 // Method java/lang/Number.intValue:()I
     349: istore        10
     351: aload         9
     353: invokevirtual #107                // Method kotlin/Pair.component2:()Ljava/lang/Object;
     356: checkcast     #18                 // class java/lang/Number
     359: invokevirtual #110                // Method java/lang/Number.doubleValue:()D
     362: dstore        11
     364: aload_3
     365: iload         4
     367: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     372: checkcast     #34                 // class "[D"
     375: iload         6
     377: dload         11
     379: dastore
     380: iload         10
     382: istore        5
     384: iinc          6, 1
     387: goto          128
     390: iload         4
     392: iload_1
     393: if_icmpeq     402
     396: iinc          4, 1
     399: goto          108
     402: aload_3
     403: iload_1
     404: invokeinterface #16,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
     409: checkcast     #34                 // class "[D"
     412: iload_2
     413: iload_1
     414: isub
     415: daload
     416: iconst_2
     417: i2d
     418: dmul
     419: iload_1
     420: i2d
     421: dadd
     422: dreturn

  private static final <T, R extends java.lang.Comparable<? super R>> kotlin.Pair<T, R> minByAndValue(java.lang.Iterable<? extends T>, kotlin.jvm.functions.Function1<? super T, ? extends R>);
    Code:
       0: iconst_0
       1: istore_2
       2: aload_0
       3: invokestatic  #56                 // Method kotlin/collections/CollectionsKt.asSequence:(Ljava/lang/Iterable;)Lkotlin/sequences/Sequence;
       6: new           #147                // class codeforces/round901/DKt$minByAndValue$1
       9: dup
      10: aload_1
      11: invokespecial #150                // Method codeforces/round901/DKt$minByAndValue$1."<init>":(Lkotlin/jvm/functions/Function1;)V
      14: checkcast     #63                 // class kotlin/jvm/functions/Function1
      17: invokestatic  #69                 // Method kotlin/sequences/SequencesKt.map:(Lkotlin/sequences/Sequence;Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;
      20: astore_3
      21: iconst_0
      22: istore        4
      24: aload_3
      25: invokeinterface #75,  1           // InterfaceMethod kotlin/sequences/Sequence.iterator:()Ljava/util/Iterator;
      30: astore        5
      32: aload         5
      34: invokeinterface #81,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      39: ifne          50
      42: new           #83                 // class java/util/NoSuchElementException
      45: dup
      46: invokespecial #86                 // Method java/util/NoSuchElementException."<init>":()V
      49: athrow
      50: aload         5
      52: invokeinterface #90,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      57: astore        6
      59: aload         5
      61: invokeinterface #81,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      66: ifne          74
      69: aload         6
      71: goto          155
      74: aload         6
      76: checkcast     #92                 // class kotlin/Pair
      79: astore        7
      81: iconst_0
      82: istore        8
      84: aload         7
      86: invokevirtual #95                 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
      89: checkcast     #97                 // class java/lang/Comparable
      92: astore        7
      94: aload         5
      96: invokeinterface #90,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
     101: astore        8
     103: aload         8
     105: checkcast     #92                 // class kotlin/Pair
     108: astore        9
     110: iconst_0
     111: istore        10
     113: aload         9
     115: invokevirtual #95                 // Method kotlin/Pair.getSecond:()Ljava/lang/Object;
     118: checkcast     #97                 // class java/lang/Comparable
     121: astore        9
     123: aload         7
     125: aload         9
     127: invokeinterface #101,  2          // InterfaceMethod java/lang/Comparable.compareTo:(Ljava/lang/Object;)I
     132: ifle          143
     135: aload         8
     137: astore        6
     139: aload         9
     141: astore        7
     143: aload         5
     145: invokeinterface #81,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
     150: ifne          94
     153: aload         6
     155: checkcast     #92                 // class kotlin/Pair
     158: areturn

  public static final void main();
    Code:
       0: iconst_1
       1: istore_0
       2: iconst_0
       3: istore_1
       4: iload_1
       5: iload_0
       6: if_icmpge     33
       9: iload_1
      10: istore_2
      11: iconst_0
      12: istore_3
      13: invokestatic  #163                // Method solve:()D
      16: dstore        4
      18: getstatic     #169                // Field java/lang/System.out:Ljava/io/PrintStream;
      21: dload         4
      23: invokevirtual #175                // Method java/io/PrintStream.println:(D)V
      26: nop
      27: iinc          1, 1
      30: goto          4
      33: return

  private static final java.util.List<java.lang.String> readStrings();
    Code:
       0: invokestatic  #184                // Method kotlin/io/ConsoleKt.readln:()Ljava/lang/String;
       3: checkcast     #186                // class java/lang/CharSequence
       6: iconst_1
       7: anewarray     #188                // class java/lang/String
      10: astore_0
      11: aload_0
      12: iconst_0
      13: ldc           #190                // String
      15: aastore
      16: aload_0
      17: iconst_0
      18: iconst_0
      19: bipush        6
      21: aconst_null
      22: invokestatic  #196                // 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  #199                // Method readStrings:()Ljava/util/List;
       3: checkcast     #50                 // 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  #203                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      21: invokespecial #28                 // Method java/util/ArrayList."<init>":(I)V
      24: checkcast     #205                // class java/util/Collection
      27: astore_3
      28: iconst_0
      29: istore        4
      31: aload_2
      32: invokeinterface #206,  1          // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      37: astore        5
      39: aload         5
      41: invokeinterface #81,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      46: ifeq          92
      49: aload         5
      51: invokeinterface #90,  1           // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      56: astore        6
      58: aload_3
      59: aload         6
      61: checkcast     #188                // class java/lang/String
      64: astore        7
      66: astore        9
      68: iconst_0
      69: istore        8
      71: aload         7
      73: invokestatic  #212                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      76: nop
      77: invokestatic  #216                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      80: aload         9
      82: swap
      83: invokeinterface #217,  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  #229                // Method main:()V
       3: return
}

Compiled from "d.kt"
public final class codeforces.round901.DKt$minByAndValue$1 implements kotlin.jvm.functions.Function1<T, kotlin.Pair<? extends T, ? extends R>> {
  final kotlin.jvm.functions.Function1<T, R> $selector;

  public codeforces.round901.DKt$minByAndValue$1(kotlin.jvm.functions.Function1<? super T, ? extends R>);
    Code:
       0: aload_0
       1: aload_1
       2: putfield      #14                 // Field $selector:Lkotlin/jvm/functions/Function1;
       5: aload_0
       6: invokespecial #17                 // Method java/lang/Object."<init>":()V
       9: return

  public final kotlin.Pair<T, R> invoke(T);
    Code:
       0: aload_1
       1: aload_0
       2: getfield      #14                 // Field $selector:Lkotlin/jvm/functions/Function1;
       5: aload_1
       6: invokeinterface #25,  2           // InterfaceMethod kotlin/jvm/functions/Function1.invoke:(Ljava/lang/Object;)Ljava/lang/Object;
      11: invokestatic  #31                 // Method kotlin/TuplesKt.to:(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
      14: areturn

  public java.lang.Object invoke(java.lang.Object);
    Code:
       0: aload_0
       1: aload_1
       2: invokevirtual #35                 // Method invoke:(Ljava/lang/Object;)Lkotlin/Pair;
       5: areturn
}


package codeforces.round752

const val M = 998244353

private fun solve(): Long {
	readLn()
	val a = readInts()

	val memoNext = IntArray(a.size)
	val memoValue = LongArray(a.size)
	fun solve(i: Int, next: Int): Long {
		if (i == -1) return 0
		if (memoNext[i] == next) return memoValue[i]
		val countHere = (a[i] + next - 1) / next
		val res = (i + 1L) * (countHere - 1) + solve(i - 1, a[i] / countHere)
		memoNext[i] = next
		memoValue[i] = res
		return res
	}

	return a.indices.sumOf { solve(it - 1, a[it]) % M } % M
}

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

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

Compiled from "c.kt"
public final class codeforces.round752.CKt {
  public static final int M;

  private static final long solve();
    Code:
       0: invokestatic  #10                 // Method readLn:()Ljava/lang/String;
       3: pop
       4: invokestatic  #14                 // Method readInts:()Ljava/util/List;
       7: astore_0
       8: aload_0
       9: invokeinterface #20,  1           // InterfaceMethod java/util/List.size:()I
      14: newarray       int
      16: astore_1
      17: aload_0
      18: invokeinterface #20,  1           // InterfaceMethod java/util/List.size:()I
      23: newarray       long
      25: astore_2
      26: aload_0
      27: checkcast     #22                 // class java/util/Collection
      30: invokestatic  #28                 // Method kotlin/collections/CollectionsKt.getIndices:(Ljava/util/Collection;)Lkotlin/ranges/IntRange;
      33: checkcast     #30                 // class java/lang/Iterable
      36: astore_3
      37: lconst_0
      38: lstore        4
      40: aload_3
      41: invokeinterface #34,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      46: astore        6
      48: aload         6
      50: invokeinterface #40,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      55: ifeq          119
      58: aload         6
      60: checkcast     #42                 // class kotlin/collections/IntIterator
      63: invokevirtual #45                 // Method kotlin/collections/IntIterator.nextInt:()I
      66: istore        7
      68: lload         4
      70: iload         7
      72: istore        8
      74: lstore        10
      76: iconst_0
      77: istore        9
      79: aload_1
      80: aload_2
      81: aload_0
      82: iload         8
      84: iconst_1
      85: isub
      86: aload_0
      87: iload         8
      89: invokeinterface #49,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      94: checkcast     #51                 // class java/lang/Number
      97: invokevirtual #54                 // Method java/lang/Number.intValue:()I
     100: invokestatic  #58                 // Method solve$solve:([I[JLjava/util/List;II)J
     103: ldc           #59                 // int 998244353
     105: i2l
     106: lrem
     107: lstore        12
     109: lload         10
     111: lload         12
     113: ladd
     114: lstore        4
     116: goto          48
     119: lload         4
     121: ldc           #59                 // int 998244353
     123: i2l
     124: lrem
     125: lreturn

  public static final void main();
    Code:
       0: invokestatic  #75                 // Method readInt:()I
       3: istore_0
       4: iconst_0
       5: istore_1
       6: iload_1
       7: iload_0
       8: if_icmpge     35
      11: iload_1
      12: istore_2
      13: iconst_0
      14: istore_3
      15: invokestatic  #77                 // Method solve:()J
      18: lstore        4
      20: getstatic     #83                 // Field java/lang/System.out:Ljava/io/PrintStream;
      23: lload         4
      25: invokevirtual #89                 // Method java/io/PrintStream.println:(J)V
      28: nop
      29: iinc          1, 1
      32: goto          6
      35: return

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

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

  private static final java.util.List<java.lang.String> readStrings();
    Code:
       0: invokestatic  #10                 // Method readLn:()Ljava/lang/String;
       3: checkcast     #111                // class java/lang/CharSequence
       6: iconst_1
       7: anewarray     #113                // class java/lang/String
      10: astore_0
      11: aload_0
      12: iconst_0
      13: ldc           #115                // String
      15: aastore
      16: aload_0
      17: iconst_0
      18: iconst_0
      19: bipush        6
      21: aconst_null
      22: invokestatic  #121                // 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  #124                // Method readStrings:()Ljava/util/List;
       3: checkcast     #30                 // class java/lang/Iterable
       6: astore_0
       7: iconst_0
       8: istore_1
       9: aload_0
      10: astore_2
      11: new           #126                // class java/util/ArrayList
      14: dup
      15: aload_0
      16: bipush        10
      18: invokestatic  #130                // Method kotlin/collections/CollectionsKt.collectionSizeOrDefault:(Ljava/lang/Iterable;I)I
      21: invokespecial #134                // Method java/util/ArrayList."<init>":(I)V
      24: checkcast     #22                 // class java/util/Collection
      27: astore_3
      28: iconst_0
      29: istore        4
      31: aload_2
      32: invokeinterface #34,  1           // InterfaceMethod java/lang/Iterable.iterator:()Ljava/util/Iterator;
      37: astore        5
      39: aload         5
      41: invokeinterface #40,  1           // InterfaceMethod java/util/Iterator.hasNext:()Z
      46: ifeq          92
      49: aload         5
      51: invokeinterface #138,  1          // InterfaceMethod java/util/Iterator.next:()Ljava/lang/Object;
      56: astore        6
      58: aload_3
      59: aload         6
      61: checkcast     #113                // class java/lang/String
      64: astore        7
      66: astore        9
      68: iconst_0
      69: istore        8
      71: aload         7
      73: invokestatic  #107                // Method java/lang/Integer.parseInt:(Ljava/lang/String;)I
      76: nop
      77: invokestatic  #142                // Method java/lang/Integer.valueOf:(I)Ljava/lang/Integer;
      80: aload         9
      82: swap
      83: invokeinterface #146,  2          // InterfaceMethod java/util/Collection.add:(Ljava/lang/Object;)Z
      88: pop
      89: goto          39
      92: aload_3
      93: checkcast     #16                 // class java/util/List
      96: nop
      97: areturn

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

  private static final long solve$solve(int[], long[], java.util.List<java.lang.Integer>, int, int);
    Code:
       0: iload_3
       1: iconst_m1
       2: if_icmpne     7
       5: lconst_0
       6: lreturn
       7: aload_0
       8: iload_3
       9: iaload
      10: iload         4
      12: if_icmpne     19
      15: aload_1
      16: iload_3
      17: laload
      18: lreturn
      19: aload_2
      20: iload_3
      21: invokeinterface #49,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      26: checkcast     #51                 // class java/lang/Number
      29: invokevirtual #54                 // Method java/lang/Number.intValue:()I
      32: iload         4
      34: iadd
      35: iconst_1
      36: isub
      37: iload         4
      39: idiv
      40: istore        5
      42: iload_3
      43: i2l
      44: lconst_1
      45: ladd
      46: iload         5
      48: iconst_1
      49: isub
      50: i2l
      51: lmul
      52: aload_0
      53: aload_1
      54: aload_2
      55: iload_3
      56: iconst_1
      57: isub
      58: aload_2
      59: iload_3
      60: invokeinterface #49,  2           // InterfaceMethod java/util/List.get:(I)Ljava/lang/Object;
      65: checkcast     #51                 // class java/lang/Number
      68: invokevirtual #54                 // Method java/lang/Number.intValue:()I
      71: iload         5
      73: idiv
      74: invokestatic  #58                 // Method solve$solve:([I[JLjava/util/List;II)J
      77: ladd
      78: lstore        6
      80: aload_0
      81: iload_3
      82: iload         4
      84: iastore
      85: aload_1
      86: iload_3
      87: lload         6
      89: lastore
      90: lload         6
      92: lreturn
}