21719_Icandoit!

2022-5-16 18:20| 发布者: Hocassian| 查看: 25| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-4-89505789751400-Problem List-采集的数据-后羿采集器.html

Pro.ID

21719

Title

I can do it!

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=21719

AC

5

Submit

7

Ratio

71.43%

时间&空间限制

  • Time Limit: 2000/1000 MS (Java/Others)     Memory Limit: 65536/32768 K (Java/Others)
  • 描述

    Given n elements, which have two properties, say Property A and Property B. For convenience, we use two integers Ai and Bi to measure the two properties.

    Your task is, to partition the element into two sets, say Set A and Set B (cannot be empty!), which minimizes the value of   max(x∈Set A) {Ax} + max(y∈Set B) {By}.

    See sample test cases for further details.

    输入

    There are multiple test cases, the first line of input contains an integer denoting the number of test cases.

    For each test case, the first line contains an integer N, indicates the number of elements. (1 ≤ N ≤ 100000)

    For the next N lines, every line contains two integers Ai and Bi indicate the Property A and Property B of the ith element. (0 ≤ Ai, Bi ≤ 1000000000)

    输出

    Description

    Given n elements, which have two properties, say Property A and Property B. For convenience, we use two integers Ai and Bi to measure the two properties.

    Your task is, to partition the element into two sets, say Set A and Set B (cannot be empty!), which minimizes the value of   max(x∈Set A) {Ax} + max(y∈Set B) {By}.

    See sample test cases for further details.

    Input

    There are multiple test cases, the first line of input contains an integer denoting the number of test cases.

    For each test case, the first line contains an integer N, indicates the number of elements. (1 ≤ N ≤ 100000)

    For the next N lines, every line contains two integers Ai and Bi indicate the Property A and Property B of the ith element. (0 ≤ Ai, Bi ≤ 1000000000)

    Output

    For each test cases, output the minimum value.

    Sample Input

    1
    3
    1 100
    2 100
    3 1

    Sample Output

    Case 1: 3

    Source

    样例输入

    1
    3
    1 100
    2 100
    3 1

    样例输出

    Case 1: 3

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部