🏡 index : github.com/captn3m0/codechef.git

---
{"category_name":"easy","problem_code":"NUM239","problem_name":"Counting Pretty Numbers","languages_supported":{"0":"C","1":"CPP14","2":"JAVA","3":"PYTH","4":"PYTH 3.6","5":"PYPY","6":"CS2","7":"PAS fpc","8":"PAS gpc","9":"RUBY","10":"PHP","11":"GO","12":"NODEJS","13":"HASK","14":"rust","15":"SCALA","16":"swift","17":"D","18":"PERL","19":"FORT","20":"WSPC","21":"ADA","22":"CAML","23":"ICK","24":"BF","25":"ASM","26":"CLPS","27":"PRLG","28":"ICON","29":"SCM qobi","30":"PIKE","31":"ST","32":"NICE","33":"LUA","34":"BASH","35":"NEM","36":"LISP sbcl","37":"LISP clisp","38":"SCM guile","39":"JS","40":"ERL","41":"TCL","42":"kotlin","43":"PERL6","44":"TEXT","45":"SCM chicken","46":"PYP3","47":"CLOJ","48":"COB","49":"FS"},"max_timelimit":1,"source_sizelimit":50000,"problem_author":"isaf27","problem_tester":null,"date_added":"24-06-2018","tags":{"0":"cakewalk","1":"isaf27","2":"isaf27","3":"likecs","4":"ltime61","5":"prefix"},"editorial_url":"https://discuss.codechef.com/problems/NUM239","time":{"view_start_date":1530378000,"submit_start_date":1530378000,"visible_start_date":1530378000,"end_date":1735669800},"is_direct_submittable":false,"layout":"problem"}
---
<span class="solution-visible-txt">All submissions for this problem are available.</span><h3>Read problems statements in <a target="_blank" 
href="http://www.codechef.com/download/translated/LTIME61/mandarin/NUM239.pdf">Mandarin chinese</a>, <a target="_blank" 
href="http://www.codechef.com/download/translated/LTIME61/russian/NUM239.pdf">Russian</a> and <a target="_blank" 
href="http://www.codechef.com/download/translated/LTIME61/vietnamese/NUM239.pdf">Vietnamese</a> as well.</h3>

Vasya likes the number $239$. Therefore, he considers a number *pretty* if its last digit is $2$, $3$ or $9$. 

Vasya wants to watch the numbers between $L$ and $R$ (both inclusive), so he asked you to determine how many pretty numbers are in this range. Can you help him?

### Input
- The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.
- The first and only line of each test case contains two space-separated integers $L$ and $R$.

### Output
For each test case, print a single line containing one integer — the number of pretty numbers between $L$ and $R$.

### Constraints
- $1 \le T \le 100$
- $1 \le L \le R \le 10^5$

### Subtasks
**Subtask #1 (100 points):** original constraints

### Example Input
```
2
1 10
11 33
```

### Example Output
```
3
8
```

### Explanation
**Example case 1:** The pretty numbers between $1$ and $10$ are $2$, $3$ and $9$.

**Example case 2:** The pretty numbers between $11$ and $33$ are $12$, $13$, $19$, $22$, $23$, $29$, $32$ and $33$.