So I'm trying to do a codeforces problem (my first!) and I'm trying to read the input.
I initially tried using os.Args, but that caused a runtime error.
I am now trying this
package main
import (
"fmt"
)
func main() {
var n int
var m int
var a int
fmt.Scanf("%d", &n)
fmt.Scanf("%d", &m)
fmt.Scanf("%d", &a)
rectangleArea := n*m
squareArea := a*a
nSquares := 0
for i := 0; i < rectangleArea + squareArea; i = i + squareArea {
nSquares++
}
fmt.Println(nSquares)
}
But this seems to go into infinite loop when I run it with the arguments 6 6 4. Well, it goes into infinite loop with any argument.
What's going on?