
#include <iostream>#include <algorithm>
using namespace std;// 定义结构体类型
struct Participant {int num;int score;
};// 使用结构体类型定义数组
Participant u[5050];// 比较函数
bool compare(const Participant& a, const Participant& b) {if (a.score == b.score) {return a.num < b.num; // 如果 score 相同,按 num 升序排序}return a.score > b.score; // 按 score 降序排序
}int main() {int n, k;cin >> n >> k;int kk = k * 1.5;if (kk > n) {kk = n; // 如果 kk 超过 n,则取 n}// 输入数据for (int i = 0; i < n; i++) {cin >> u[i].num >> u[i].score;}// 使用自定义比较函数对数组排序int sum = 0;sort(u, u + n, compare);for (int i = 0; i < n; i++) {if (u[i].score >= u[kk - 1].score){sum++;}}// 输出前 kk 个元素cout << u[kk - 1].score << sum << endl;for (int i = 0; i < sum; i++) {cout << u[i].num << " " << u[i].score << endl;}return 0;
}

//#include<iostream>
//#include<cmath>
//using namespace std;
//bool pan(int x1, int x2)
//{
// if (x1 != 1&&x1!=2)
// {
// for (int i = 2; i < x1; i++)
// {
// if (x1 % i == 0)
// {
// return false;
// }
//
// }
// }
// if (x2 != 1&&x2!=2)
// {
// for (int i = 2; i < x2; i++)
// {
// if (x2 % i == 0)
// {
// return false;
// }
// }
// }
// return true;
//}
//
//int main()
//{
// int k = 1;
// int n;
// cin >> n;
// for (int i = 1; i <= n; i++)
// {
// for (int j = i;j<=n; j++)
// {
// if (i == j)
// {
// continue;
// }
// if (i * j == n)
// {
// if (pan(i, j))
// {
// int p = max(i, j);
// if (p > k)
// {
// k = p;
// }
// }
// }
//
// }
// }
// cout << k;
//}
#include <iostream>
#include <cmath>
using namespace std;// 判断一个数是否为质数
bool isPrime(int x) {if (x <= 1) return false; // 1不是质数if (x == 2) return true; // 2是质数if (x % 2 == 0) return false; // 排除偶数for (int i = 3; i <= sqrt(x); i += 2) { // 只遍历奇数if (x % i == 0) return false;}return true;
}int main() {int n;cin >> n;int maxPrime = -1;// 遍历到 sqrt(n)for (int i = 2; i <= sqrt(n); i++) {if (n % i == 0) { // 如果 i 是 n 的因子int j = n / i; // 计算对应的 jif (isPrime(i) && isPrime(j)) { // 检查 i 和 j 是否都是质数maxPrime = max(maxPrime, max(i, j)); // 更新最大质数}}}cout << maxPrime << endl;return 0;
}