Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define ll long long
- int main()
- {
- ll t;
- cin >> t;
- while(t--) {
- ll n;
- cin >> n;
- int a[n];
- // int f[21]={0};
- for(int i=0;i<n;i++) {
- cin >> a[i];
- // f[a[i]]++;
- }
- ll p, q, r;
- sort(a,a+n);
- ll size = n-2;
- for(int i=1;1;i++) {
- if(size%i==0) {
- p = size / i;
- }
- if(binary_search(a,a+n,p)&&binary_search(a,a+n,i)) {
- cout << i << ' ' << p << endl;
- break;
- }
- }
- // cout << p << ' ' << r << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement