Coprime Present

AtCoder
IDabc195_f
Time2000ms
Memory256MB
Difficulty
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: $A$ $B$ [samples]
Samples
Input #1
2 4
Output #1
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}$
Input #2
1 1
Output #2
2

The following two sets of cards will make Snuke happy:

*   ${}$
*   ${1}$
Input #3
123456789000 123456789050
Output #3
2125824
API Response (JSON)
{
  "problem": {
    "name": "Coprime Present",
    "description": {
      "content": "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,",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc195_f"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "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.\nSnuke will be happy if,...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments