I was trying to solve this question. After trying enough i finally read the tutorial. Suppose the minimum number, is a[0]=600. Then we need to calculate how many elements of size 2*600-1=1999 can we form i.e. we simply need to divide each of the a[i] by 1999 and add each of them. But this code
include <bits/stdc++.h>
using namespace std;
define MULTI int _T; cin >> _T; while(_T--)
typedef long long ll; typedef pair<int, int> ii; typedef vector vi; typedef vector vii;
int main() { ios::sync_with_stdio(false); cin.tie(0);
MULTI { int n; cin>>n; vector<int> a(n); long long sum = 0; for(int i=0;i<n;++i) { cin>>a[i]; } for(int i = 0;i<n;++i) { sum+=(a[i])/(2*a[0]-1); } cout<<sum<<endl; }
} is giving ![](https://i.imgur.com/uP7DC4e.png).