Sum of Consecutive Numbers
Time limit0.5sMemory limit1024 MB
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 , determine whether can be written as the sum of two or more consecutive positive integers.
Input
Each line of the input contains a single integer with . The input ends with , which is not processed.
Output
For each input line, print one line containing SIM if can be written in the described way, and NAO otherwise.