fun main(arr:Array) { val deskKind = readLine()!!.toInt() val mod = 1000000000 + 7 var total = 0L for(i in (0 until deskKind)) { val (isu, tsukue) = readLine()!!.split(" ").map { it.toLong() } var tmp = isu / 2 if (isu % 2 != 0L) { tmp++ } tmp = tmp % mod tmp = tmp * (tsukue % mod) tmp = tmp % mod total += tmp total = total % mod } println(total) }