A1472.[COCI-2012_2013-contest1]#6 SNAGA

省选/NOI-

COCI

通过率:0%

时间限制:1.00s

内存限制:128MB

题目描述

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)

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).

输入格式

The first and only line of input contains two positive integers, A and B (3 ≤ A < B < 10^17).

输出格式

The first and only line of output should contain the requested sum of strengths.

输入输出样例

  • 输入#1

    3 6

    输出#1

    11
  • 输入#2

    100 200

    输出#2

    262

说明/提示

首页