2024年最新Group QQ Speed 数学 思维,C C++经典入门教程

img
img

既有适合小白学习的零基础资料,也有适合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 IputStandard Oputput
248 84 233

Solution

😀 算法标签:数学/思维
  1. 如果所有人在同一组里,由于每个人都可能会禁掉不同的地图,因此我们应该有

n

img
img

网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化的资料的朋友,可以添加戳这里获取

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!

群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值