Under construction

Still being built. Things may change

Sum of Consecutive Numbers

Time limit0.5sMemory limit1024 MB

Summary
For each integer n until 0, decide whether n is a sum of two or more consecutive positive integers, printing SIM or NAO.
Level

Easy3 of 10

Topics
Math, Number theory
Solved
No attempts yet

Problem

Given an integer nn, determine whether nn can be written as the sum of two or more consecutive positive integers.

Input

Each line of the input contains a single integer nn with 1<n≤10000000001 < n \le 1000000000. The input ends with n=0n = 0, which is not processed.

Output

For each input line, print one line containing SIM if nn can be written in the described way, and NAO otherwise.

Examples1

  1. Example 1

    Input
    7
    8
    9
    10
    0
    
    Expected output
    SIM
    NAO
    SIM
    SIM