Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- typedef long long ll;
- int sort(int A[],long long p){
- for (int i=0;i<p-1;i++){
- for(int k=0;k<p-i-1;k++){
- if (A[i] > A[i+1]){
- int j = A[i];
- A[i] = A[i+1];
- A[i+1] = j;
- }
- }
- }
- }
- using namespace std;
- int main(){
- ios::sync_with_stdio(0);
- cin.tie(0);
- ll N; //number of customers
- scanf("%lld",&N);
- int budget[N]; //Budgets of customers
- for (int i=0;i<N;i++){
- cin >> budget[i];
- }
- sort(budget,N);
- int Average[N];
- for (int i=1;i<N;i++){
- Average[0] = 0;
- Average[i] += budget[i]/i;
- }
- sort(Average,N);
- cout << Average[N];
- }
Add Comment
Please, Sign In to add comment