fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main(){
  5. int t,n,x; cin >> t;
  6. while(t--){
  7. cin >> n;
  8. set<int>s;
  9. for(int i=0;i<n;i++){
  10. cin >> x;
  11. s.insert(x);
  12. }
  13. if(s.size() == 3) cout << "1 1\n";
  14. else{
  15. for(auto it=s.begin();it!=s.end();++it){
  16. int y = (n-2) / *it;
  17. cout << y << endl;
  18. }
  19. }
  20. }
  21. return 0;
  22. }
Success #stdin #stdout 0.01s 5272KB
stdin
5
4
1 1 2 3
11
3 3 4 5 6 7 8 9 9 10 11
8
8 4 8 3 8 2 8 1
6
2 1 4 5 3 3
8
1 2 6 3 8 5 5 3
stdout
1 1
3
2
1
1
1
1
1
0
0
6
3
2
1
0
4
2
1
1
0
6
3
2
1
1
0