编程介的小学生 2017-02-20 04:18 采纳率: 20.5%
浏览 905
已采纳

Treasure Hunting

问题描述 :

Zstu_yhr is a very curious person who fell in love with math when he was in elementary school phase. When he entered the middle school, he learned Multiplication and Power Multiplication. yhr is so ambitious that he not only dreams to be a mathematician but also dreams to be richer than Bill Gates.
One day, he is suddenly encountered with a crazy thought that is to hunt treasure to make one of his dreams a reality. Since yhr is such a strong-willed person that he will never give up as long as his goal has not been achieved. After going through 9*9 challenges, as a reward of god for that hard, he finally discovers an antique hole which is very likely to have a good number of treasures in it. However, as every novel writes, he can never get the treasures so easily. He has to open a coded door at first. He finds that there are 2*N numbers on the door. He speculates that they must be able to generate the password. Disappointedly, there isn’t any clue left for him. He has no better way but to YY. Firstly, he divides these 2*N number into N piles equally. The first pile is composed of a1,b1 and the second pile is composed of a2,b2…certainly, the i-th pile is composed of ai,bi…After completing this task, he calculates a1^b1*a2^b2*a3^b3…*an^bn and gets its result M. He takes M as the password to open the door. What’s a pity, he fails. Then he starts to YY again. Maybe the right password is the minimum number x which satisfies the equation x!%M=0. So he wants to have a try. But he doesn’t know how to get the number so that he has to turn to you for help. Can you help him?
输入:

In the first line is an integer T (1<=T<=50) indicating the number of test cases.
Each test case begins with an integer n (1<=n<=100), then followed n lines. Each line contains two numbers ai and bi (1 <= ai <= 100, 1<=bi<=10000000000000)
输出:

In the first line is an integer T (1<=T<=50) indicating the number of test cases.
Each test case begins with an integer n (1<=n<=100), then followed n lines. Each line contains two numbers ai and bi (1 <= ai <= 100, 1<=bi<=10000000000000)
样例输入:

1
2
3 2
4 1
样例输出:

6

  • 写回答

3条回答 默认 最新

  • devmiao 2017-02-20 16:59
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)