{"problem":{"name":"Different Distribution","description":{"content":"A group of people played a game. All players had distinct scores, which are non-negative integers. Takahashi knows $N$ facts on the players' scores. The $i$\\-th fact is as follows: the $A_i$\\-th highe","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"tenka1_2017_b"},"statements":[{"statement_type":"Markdown","content":"A group of people played a game. All players had distinct scores, which are non-negative integers.\nTakahashi knows $N$ facts on the players' scores. The $i$\\-th fact is as follows: the $A_i$\\-th highest score among the players is $B_i$.\nFind the maximum possible number of players in the game.\n\n## Constraints\n\n*   $1 \\leq N \\leq 10^5$\n*   $1 \\leq A_i \\leq 10^9(1\\leq i\\leq N)$\n*   $0 \\leq B_i \\leq 10^9(1\\leq i\\leq N)$\n*   If $i ≠ j$, $A_i ≠ A_j$.\n*   There exists a possible outcome of the game that are consistent with the facts.\n*   All input values are integers.\n\n## Inputs\n\nInput is given from Standard Input in the following format:\n\n$N$\n$A_1$ $B_1$\n:\n$A_N$ $B_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"tenka1_2017_b","tags":[],"sample_group":[["3\n4 7\n2 9\n6 2","8\n\nThe maximum possible number of players is achieved when, for example, the players have the following scores: $12,9,8,7,5,2,1,0$."],["5\n1 10\n3 6\n5 2\n4 4\n2 8","7"],["2\n1 1000000000\n1000000000 1","1000000001"]],"created_at":"2026-03-03 11:01:14"}}