既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上C C++开发知识点,真正体系化!
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新
Input file: standard
Input Output file: standard
Output Time limit: 1 second
Memory limit: 512 megabytes
Problem Description
Cuber QQ likes QQ Speed, he always plays the game throughout all night, until early morning.
On a dark and gusty night, as usual, Cuber QQ was playing the 48-player knockout round of QQ Speed, and it was his turn to “ban the map”. He suddenly had an idea for the programming contest.
In each contest round, there are n players. The gaming system will give all players x maps, and each player can ban a map. After that, the gaming system will evenly, but not necessarily randomly, divide the players into m groups (m divides n). Every player in the same group must race on the same map, and different groups can either race on the same map or not. If one of the players in the group have banned a map, this map cannot be used by this group any more. Now, Cuber QQ wants to know the minimal number of maps the gaming system needs to provide to the players, and these maps can ensure having at least one grouping scheme in any case.
Input
The first line contains a single integer T (1 ≤ T ≤ 105 ) — the number of test cases. Each of the next T lines contains two integers n and m (1 ≤ n, m ≤ 109 , m | n).
Output
For each test case, output one line containing one integer which is the answer.
Example
Standard Iput | Standard Oputput |
248 84 2 | 33 |
Solution
😀 算法标签:数学/思维 |
- 如果所有人在同一组里,由于每个人都可能会禁掉不同的地图,因此我们应该有
n
网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**