package Yukicoder /** * Created by hichikawa on 2015/11/12. */ fun main(args: Array) { fun readLineLongArray(): List { val str = readLine() as String val arrStr = str.split(" ") val ret = arrStr.map { it.toLong() } return ret } fun readLineLong(): Long { val str = readLine() as String return str.toLong() } fun readLineInt(): Int { val str = readLine() as String return str.toInt() } fun readLineIntArray() : List { val str = readLine() as String val arrStr = str.split(" ") val ret = arrStr.map { it.toInt() } return ret } fun readLineDoubleArray(): List { val str = readLine() as String val arrStr = str.split(" ") val ret = arrStr.map { it.toDouble() } return ret } var num = readLineLong() var ans = 1.toLong() while (num != 1.toLong()) { for (i in 2..2) { var count = 0 while (true) { if (num % i == 0.toLong()) { num /= i count++ } else { break } } if (count % 2 == 1) { ans *= i } } for (i in 3.toLong()..Math.sqrt(num.toDouble()).toLong() step 2) { var count = 0 while (true) { if (num % i == 0.toLong()) { num /= i count++ } else { break } } if (count % 2 == 1) { ans *= i } } println(ans) } }