编程介的小学生
2017-11-23 16:33
采纳率: 92.7%
浏览 851
已采纳

Find Its Place

Problem Description
Have you seen the National Day military review? That’s very grand!
And now, ALPCs have received a arduous mission——taking a parade at August first.
The traditional order is rectangular, but ALPCs want to make a innovation. They start to research a new triangular order called Yang Hui’s triangle.
Yang Hui’s triangle is known to all:
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
In it the ends of each line is 1, and every other number in each line equals to the sum of the two numbers on the shoulders. It’s obvious that it’s a piece of cake (especially with the help of computer)for us to get value of the C-th number in line R, therefore our problem goes to the opposite: given two Continuous numbers in a same line, please find out their positions in this huge triangle.

Input
The first line of the input is a N indicating the test cases number.
Then follow N lines. Each line includes two positive integers: a, b, and a, b < 2^63. The number a should be aligned on the left of the number b. It’s certain that for every data input there is always a solution.

Output
For each testing data there will be only one line out: R C. which means the C-th number on line R. What’s more, R and C should be separated by a blank space. For multiple solutions, please print out the solution with the minimum R.

Sample Input
3
1 2
3 3
10 5

Sample Output
3 1
4 2
6 4

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • 已采纳
    点赞 打赏 评论
  • LEAD315 2018-02-25 13:35

    当IE无法浏览网页时,可先尝试用IP地址来访问,如用 的 ,如果可以访问,那么应该是DNS的问题,造成DNS的问题可能是连网时获取DNS出错或DNS服务器本身问题,这时你可以手动指定DNS服务(地址可以是你当地ISP提供的DNS服务器地址,也可以用其它地方可正常使用DNS服务器地址。)在网络的属性里进行,(控制面板—网络和拔号连接—本地连接—右键属性—TCP
    IP协议—属性—使用下面的DNS服务器地址)。不同的ISP有不同的DNS地址。有时候则是路由器或网卡的问题,无法与ISP的DNS服务连接,这种情况的话,可把路由器关一会再开,或者重新设置路由器。

    还有一种可能,是本地DNS缓存出现了问题。为了提高网站访问速度,系统会自动将已经访问过并获取IP地址的网站存入本地的DNS缓存里,一旦再对这个网站进行访问,则不再通过DNS服务器而直接从本地DNS缓存取出该网站的IP地址进行访问。所以,如果本地DNS缓存出现了问题,会导致网站无法访问。可以在“运行”中执行ipconfig
    flushdns来重建本地DNS缓存。

    点赞 打赏 评论

相关推荐