Source Code:
// 5216.c
#include<stdio.h>
int main() {
// args
int const N_max = 100010;
int m, // money
n, // amount of prices
price[N_max], // price list
max_apples; // max amount of apples
// inputs
scanf("%d%d", &n, &m);
for (int i = 0; i < n; ++i) {
scanf("%d", price[i]);
}
//
return 0;
}