package main
import (
"fmt"
"math"
)
//O(akar n)
func checkPerfect(n int) string{
countDiv :=1
sq := int(math.Sqrt(float64(n)))
for i:=2;i<=sq;i++{
// mencari yg bisa membagi
if n%i == 0{
if i != n/i{
countDiv +=n/i
}
countDiv +=i
}
}
if countDiv == n {
return fmt.Sprintf("%d perfect", n)
}else if (int(math.Abs(float64(countDiv)-float64(n))) <= 2){
return fmt.Sprintf("%d almost perfect",n)
}else{
return fmt.Sprintf("%d not perfect",n)
}
}
func main() {
fmt.Println(checkPerfect(6))
}