verified here https://www.jdoodle.com/execute-go-online
and with 1.6 and 1.7 I have 0 issues with this code but as soon as i hit test 7 in http://codeforces.me/problemset/problem/448/D it breaks despite it working on every other site I try. any idea what the issue is?
package main
import "fmt"
import "math"
func calc(n int, m int, num int) int {
maxi := int(math.Sqrt(float64(num)))
re := 0
for i := 1; i <= maxi; i++ {
if num%i == 0 {
se := num / i
if (i <= n) && (se <= m) {
re++
}
if (i <= m) && (se <= n) {
re++
}
if (se == i) && (se <= n) && (se <= m) {
re--
}
}
}
return re
}
func main() {
var n, m, k int
fmt.Scanf("%d %d %d\n", &n, &m, &k)
var ans int64 = 9223372036854775807
mini := 0
maxi := n*m + 2
for mini < maxi {
var temp int = 0
var mid int = int(mini+maxi) / 2
var re int = calc(n, m, mid)
for i := 1; i <= n; i++ {
temp += int(math.Min(float64(mid/i), float64(m)))
}
var r1 int = temp - re + 1
var r2 int = temp
if (k <= r2) && (k >= r1) {
mini++
ans = int64(math.Min(float64(ans), float64(mid)))
}
if temp >= k {
maxi = mid
} else {
mini = mid + 1
}
}
fmt.Println(ans)
}








write code with integer overflow
@
bug with language
has it changed in 1.5.2 or something? it does not overflow on my machine and I have tested it on multiple machines. if that was true it would not pass any of the test cases since negative would always be less than any positive but it DOES pass some test cases. Or what fix do you suggest that works for 500000?
read the docs and don't ask stupid questions.
intsize equals to pointer size, i.e. 32 bits on 32-bit systems (like codeforces) and 64 bits on 64-bit systems (like your PC). Useint64orint32or whatever if you need fixed size