第十二篇英语翻译
出处:https://acs.jxnu.edu.cn/contest/23/board/challenge/B;
Not Sitting
描述:
Rahul and Tina are looking forward to starting their new year at college. As they enter their new classroom, they observe the seats of students are arranged in a n×mn×m grid. The seat in row rr and column cc is denoted by (r,c)(r,c), and the distance between two seats (a,b)(a,b) and (c,d)(c,d) is |a−c|+|b−d||a−c|+|b−d|.
拉胡尔和蒂娜期待着在大学开始新的一年。当他们进入新教室时,他们观察到学生的座位是以n×mn×m的网格排列的。rr行和cc列中的座椅由(r,c)(r,c)表示,两个座椅(a,b)(a,b)和(c,d)(c,d)之间的距离为| a−c |+| b−d | | a−c |+| b−d |。
As the class president, Tina has access to exactly kk buckets of pink paint. The following process occurs.
- First, Tina chooses exactly kk seats in the classroom to paint with pink paint. One bucket of paint can paint exactly one seat.
- After Tina has painted kk seats in the previous step, Rahul chooses where he sits. He will not choose a seat that has been painted pink due to his hatred of the colour pink.
- After Rahul has chosen his seat, Tina chooses a seat for herself. She can choose any of the seats, painted or not, other than the one chosen by Rahul.
Rahul wants to choose a seat such that he sits as close to Tina as possible. However, Tina wants to sit as far away from Rahul as possible due to some complicated relationship history that we couldn't fit into the statement!
作为班长,蒂娜可以拿到整整kk桶的粉红色油漆。发生以下过程。
首先,蒂娜选择了教室里的kk座位,用粉红色油漆。一桶油漆正好能油漆一个座位。
蒂娜在上一步为kk座椅上色后,拉胡尔选择他坐的地方。他不会选择一个漆成粉红色的座位,因为他讨厌粉红色。
拉胡尔选好座位后,蒂娜为自己选了一个座位。除了拉胡尔选的座位外,她可以选择任何一个座位,无论是否上漆。
拉胡尔想选择一个尽可能靠近蒂娜的座位。然而,蒂娜想坐在离拉胡尔尽可能远的地方,因为一些复杂的关系史,我们无法参与;
Now, Rahul wonders for k=0,1,…,n⋅m−1k=0,1,…,n⋅m−1, if Tina has kk buckets of paint, how close can Rahul sit to Tina, if both Rahul and Tina are aware of each other's intentions and they both act as strategically as possible? Please help satisfy Rahul's curiosity!
现在,拉胡尔想知道k=0,1,…,n⋅M−1k=0,1,…,n⋅M−1.如果蒂娜有kk桶油漆,如果拉胡尔和蒂娜都知道对方的意图,并且都尽可能从战略上采取行动,拉胡尔能和蒂娜坐得多近?请帮助满足Rahul的好奇心!
输入:
The input consists of multiple test cases. The first line contains an integer tt (1≤t≤5⋅1041≤t≤5⋅104) — the number of test cases. The description of the test cases follows.
The first line of each test case contains two integers nn, mm (2≤n⋅m≤1052≤n⋅m≤105) — the number of rows and columns of seats in the classroom.
The sum of n⋅mn⋅m across all test cases does not exceed 105105.
输入由多个测试用例组成。第一行包含一个整数tt(1)≤T≤5.⋅1041≤T≤5.⋅104)-测试用例的数量。测试用例的描述如下。
每个测试用例的第一行包含两个整数nn,mm(2≤N⋅M≤1052≤N⋅M≤105)-教室中座位的行数和列数。
n*m所有测试用例中的m不超过105105。
输出:
For each test case, output n⋅mn⋅m ordered integers — the distance between Rahul and Tina if both of them act optimally for every k∈[0,n⋅m−1]k∈[0,n⋅m−1].
样例输入:
2 4 3 1 2
样例输出:
3 3 4 4 4 4 4 4 5 5 5 5 1 1

浙公网安备 33010602011771号