Two soldiers are playing a game. At the beginning first of them chooses a positive integer n and gives it to the second soldier. Then the second one tries to make maximum possible number of rounds. Each round consists of choosing a positive integer x > 1, such that n is divisible by x and replacing n with n / x. When n becomes equal to 1 and there is no more possible valid moves the game is over and the score of the second soldier is equal to the number of rounds he performed.

To make the game more interesting, first soldier chooses n of form a! / b! for some positive integer a and b (a ≥ b). Here by k! we denote the factorial of k that is defined as a product of all positive integers not large than k.

What is the maximum possible score of the second soldier?

Input

First line of input consists of single integer t (1 ≤ t ≤ 1 000 000) denoting number of games soldiers play.

Then follow t lines, each contains pair of integers a and b (1 ≤ b ≤ a ≤ 5 000 000) defining the value of n for a game.

Output

For each game output a maximum score that the second soldier can get.

Examples

Input
2
3 1
6 3
Output
2
5

最新文章

  1. AD域撤销域用户管理员权限方案
  2. Android消息队列和Looper
  3. spring刚开始学习搭建
  4. gethostbyname 亲测可用
  5. CodeForces - 405A
  6. 如何扩大ImageView的点击区域
  7. java 多线程1
  8. ZBar之自定义二维码扫描
  9. 如何使用 Docker 部署一个基于 Play Framework 的 Scala Web 应用?
  10. 成功的GIT开发分支模型和策略
  11. Android 从java字节码告诉你 为什么Handler会造成内存泄露
  12. 为apache单独编译mod_rewrite.so
  13. SQL 远程过程调用失败【0x800706be】或正在关闭 【0x80041033】解决方法
  14. fstab设置开机挂载--鸟哥[阅读]
  15. 如何生成CA证书
  16. Quick-Cocos2d-X 捋一捋框架流程
  17. PhotoPickerNewDemo【PhotoPicker0.9.12的个性化修改以及使用(内部glide版本号是4.1.1)】
  18. Ubuntu下安装chrome浏览器
  19. tensorflow学习之(十一)将python代码写入文件
  20. Linux搭建SVN环境

热门文章

  1. bzoj4403题解
  2. 攻防世界 MISC篇
  3. NX二次开发-Block UI C++界面Object Color Picker(对象颜色拾取器)控件的获取(持续补充)
  4. Linux文件大小 指令&编程
  5. Codeforces 1183A Nearest Interesting Number
  6. 线程创建后为什么要调用CloseHandle
  7. 匈牙利算法实战codevs1022覆盖
  8. Xn数列
  9. ArcGis基础——把类别代码替换成对应中文名称的方法
  10. winform textbox 不能唤醒windows 平板的软键盘解决办法