codeforces-scrape

Codeforces scraped problems and editorials
git clone git://git.laack.co/codeforces-scrape.git
Log | Files | Refs | README

926A.md (1126B)


      1 Source: https://codeforces.com/problemset/problem/926/A
      2 
      3 A. 2-3-numbers
      4 
      5 time limit per test
      6 
      7 1 second
      8 
      9 memory limit per test
     10 
     11 256 megabytes
     12 
     13 input
     14 
     15 standard input
     16 
     17 output
     18 
     19 standard output
     20 
     21 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.
     22 
     23 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*.
     24 
     25 Input
     26 
     27 The only line contains two integers *l* and *r* (1 ≤ *l* ≤ *r* ≤ 2·109).
     28 
     29 Output
     30 
     31 Print a single integer the number of 2-3-integers on the segment [*l*, *r*].
     32 
     33 Examples
     34 
     35 Input
     36 
     37 ```
     38 1 10
     39 ```
     40 
     41 Output
     42 
     43 ```
     44 7
     45 ```
     46 
     47 Input
     48 
     49 ```
     50 100 200
     51 ```
     52 
     53 Output
     54 
     55 ```
     56 5
     57 ```
     58 
     59 Input
     60 
     61 ```
     62 1 2000000000
     63 ```
     64 
     65 Output
     66 
     67 ```
     68 326
     69 ```
     70 
     71 Note
     72 
     73 In the first example the 2-3-integers are 1, 2, 3, 4, 6, 8 and 9.
     74 
     75 In the second example the 2-3-integers are 108, 128, 144, 162 and 192.