coci试题
Let us begin with a positive integer N and find the smallest positive integer which doesn't divide N. If we repeat the procedure with the resulting number, then again with the new result and so on, we will eventually obtain the number 2 (two). Let us define strength(N) as the length of the resulting sequence.
For example, for N = 6 we obtain the sequence 6, 4, 3, 2 which consists of 4 numbers, thus strength(6) = 4.
Given two positive integers A < B, calculate the sum of strengths of all integers between A and B (inclusive), that is,
strength(A) + strength(A + 1) + ... + strength(B).
INPUT
The first and only line of input contains two positive integers, A and B (3 ≤ A < B < 1017).
OUTPUT
The first and only line of output should contain the requested sum of strengths.
SAMPLE TESTS
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说教育文库coci 2013 contest1_tasks(7)在线全文阅读。
相关推荐: