Each input file contains one test case, which gives a positive integer S (2≤N≤200), the size of the incoming traffic load.
请先登录再刷题,不会做的题目右上可以查看题解和答案~
Each input file contains one test case, which gives a positive integer S (2≤N≤200), the size of the incoming traffic load.
For each case, print two numbers in a line, namely, M, the maximum number of backend servers required, and D, the minimum of the difference between the largest and the smallest sizes in a partition with M servers. The numbers in a line must be separated by one space, and there must be no extra space at the beginning or the end of the line.
22
4 1
There are more than one way to partition the load. For example: 22 = 8 + 14 = 8 + 7 + 7 = 4 + 4 + 7 + 7 or 22 = 10 + 12 = 10 + 6 + 6 = 4 + 6 + 6 + 6 or 22 = 10 + 12 = 10 + 6 + 6 = 5 + 5 + 6 + 6 All requires 4 servers. The last partition has the smallest difference 6−5=1, hence 1 is printed out.
浙江大学2021年机试题