Type: RemoteJudge 1000ms 256MiB

[蓝桥杯 2023 国 A] 第 K 小的和

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

给定两个序列 A,BA,B,长度分别为 n,mn,m

设另有一个序列 CC 中包含了 A,BA,B 中的数两两相加的结果 (CC 中共有 n×mn\times m 个数)。问 CC 中第 KK 小的数是多少。请注意重复的数需要计算多次。例如 1,1,2,31,1,2,3 中,最小和次小都是 11,而 33 是第 44 小。

输入格式

输入的第一行包含三个整数 n,m,Kn,m,K,相邻两个整数之间使用一个空格分隔。

第二行包含 nn 个整数,分别表示 A1,A2,,AnA_1,A_2,\ldots,A_n,相邻两个整数之间使用一个空格分隔。

第三行包含 mm 个整数,分别表示 B1,B2,,BmB_1,B_2,\ldots,B_m,相邻两个整数之间使用一个空格分隔。

输出格式

输出一行包含一个整数表示答案。

3 4 5
1 3 4
2 3 5 6

6

提示

【评测用例规模与约定】

  • 对于 40%40\% 的评测用例,n,m5000n,m\le 5000Ai,Bi1000A_i,B_i\le 1000;
  • 对于所有评测用例,1n,m1051\le n,m\le 10^51Ai,Bi1091\le A_i,B_i\le 10^91Kn×m1\le K\le n\times m

2025-8 2025年CSP-J二分

Not Claimed
Status
Done
Problem
25
Open Since
2025-8-9 0:00
Deadline
2025-8-24 23:59
Extension
24 hour(s)