coci 2013 contest1_tasks(7)

2021-02-21 17:46

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


coci 2013 contest1_tasks(7).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:人教版六年级数学下册《第四单元达标测试卷》(附答案)

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: