A. 2-3-numbers

Codeforces
IDCF926A
Time1000ms
Memory256MB
Difficulty
implementationmath
A positive integer is called a _2-3-integer_, if it is equal to 2_x_·3_y_ for some non-negative integers _x_ and _y_. In other words, these integers are such integers that only have 2 and 3 among their prime divisors. For example, integers 1, 6, 9, 16 and 108 — are 2-3 integers, while 5, 10, 21 and 120 are not. Print the number of _2-3-integers_ on the given segment \[_l_, _r_\], i. e. the number of sich _2-3-integers_ _t_ that _l_ ≤ _t_ ≤ _r_. ## Input The only line contains two integers _l_ and _r_ (1 ≤ _l_ ≤ _r_ ≤ 2·109). ## Output Print a single integer the number of _2-3-integers_ on the segment \[_l_, _r_\]. [samples] ## Note In the first example the _2-3-integers_ are 1, 2, 3, 4, 6, 8 and 9. In the second example the _2-3-integers_ are 108, 128, 144, 162 and 192.
Samples
Input #1
1 10
Output #1
7
Input #2
100 200
Output #2
5
Input #3
1 2000000000
Output #3
326
API Response (JSON)
{
  "problem": {
    "name": "A. 2-3-numbers",
    "description": {
      "content": "A positive integer is called a _2-3-integer_, if it is equal to 2_x_·3_y_ for some non-negative integers _x_ and _y_. In other words, these integers are such integers that only have 2 and 3 among thei",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF926A"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "A positive integer is called a _2-3-integer_, if it is equal to 2_x_·3_y_ for some non-negative integers _x_ and _y_. In other words, these integers are such integers that only have 2 and 3 among thei...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments