Binary Division
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
When taking his computer science exam, economics student Ivan Hrivniov encountered a question asking him to determine if a given binary number is divisible by 3, 5, or 15. Please assist Ivan with this task.
Input
The input consists of a single positive integer N, presented in binary form without any leading zeros. The binary number contains no more than 10,000 digits.
Output
If the number is divisible only by 3, print "FIRST". If it is divisible only by 5, print "SECOND". If it is divisible by 15, print "BOTH". If the number is not divisible by any of these, print "NONE". All outputs should be in uppercase and without quotes.
Examples
Input #1
Answer #1
Submissions 847
Acceptance rate 26%