105. Div 3
time limit per test: 0.25 sec.
memory limit per test: 4096 KB
There is sequence 1, 12, 123, 1234, ..., 12345678910, ... . Given first N elements of that sequence. You must determine amount of numbers in it that are divisible by 3.
Input
Input contains N (1<=N<=231 - 1).
Output
Write answer to the output.
Sample Input
4
Sample Output
2
有数列1,12,123,1234,...12345678901...求从1到N位的这个数种,有几个这样的数能被3整除
样例理解: 12%3=0 123%3=0 output......
阅读全文