#G. F - Coprime Present

    传统题 1000ms 256MiB

F - Coprime Present

该比赛已结束,您无法在比赛模式下递交该题目。您可以点击“在题库中打开”以普通模式查看和递交本题。

F - Coprime Present

Score : $600$ points

Problem Statement

You have $B-A+1$ cards: for each integer from $A$ through $B$, you have one card with that integer written on it. You will give some of them (possibly none) to your pet, Snuke.

Snuke will be happy if, for every pair of different cards, the numbers written on them are pairwise coprime; otherwise, he will be sad.

How many sets of cards will make Snuke happy?

Constraints

  • $1 \leq A \leq B \leq 10^{18}$
  • $B-A \leq 72$
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

AA BB

Output

Print the number of sets of cards that will make Snuke happy. The constraints guarantee that the answer is less than $2^{63}$.


2 4
6

You have three cards with $2$, $3$, and $4$ written on them. The following six sets of cards will make Snuke happy:

  • $\{\}$
  • $\{2\}$
  • $\{3\}$
  • $\{4\}$
  • $\{2,3\}$
  • $\{3,4\}$

1 1
2

The following two sets of cards will make Snuke happy:

  • $\{\}$
  • $\{1\}$

123456789000 123456789050
2125824

2024春季入门组刷题营(七)

未参加
状态
已结束
规则
IOI
题目
8
开始于
2024-4-21 13:00
结束于
2024-4-21 15:00
持续时间
2 小时
主持人
参赛人数
12