#include using namespace std; using i8 = int8_t; using i16 = int16_t; using i32 = int32_t; using i64 = int64_t; using i128 = __int128_t; using u8 = uint8_t; using u16 = uint16_t; using u32 = uint32_t; using u64 = uint64_t; using u128 = __uint128_t; using vi32 = vector; using vi64 = vector; using vu32 = vector; using vu64 = vector; using pi32 = pair; using pi64 = pair; using pu32 = pair; using pu64 = pair; using vpi32 = vector; using vpi64 = vector; using vpu32 = vector; using vpu64 = vector; using f32 = float; using f64 = double; const char alphabetl[26] = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z' }; const char alphabetu[26] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' }; const i32 dx[4] = { 1, 0, -1, 0 }; const i32 dy[4] = { 0, 1, 0, -1 }; const double pi = 3.141592653589793238462643383279502884197169; const double napier = 2.718281828459045235360287471352662497757247; static const double EPS = 1e-8; static const i64 INF64 = 1e18; static const i32 INF32 = (1 << 30) - 1; static const i64 MOD = (i64) 1e9 + 7; const int NM = 100100; #define cauto const auto& #define bit(n) (1LL<<(n)) #define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() ); #define itn int #define ZERO(a) memset(a, 0, sizeof(a)) #define MINUS(a) memset(a, 0xff, sizeof(a)) #define INF(a) memset(a, 0x3f, sizeof(a)) #define FILL(a,c) fill(a, a+ sizeof(a)/sizeof(*a),c) #define FILL2D(A,c) fill(A[0], A[0] +sizeof(A)/sizeof(**A),c) #define FILL3D(A,c) fill(A[0][0], A[0][0] +sizeof(A)/sizeof(***A),c) #define SZ(x) ((int)(x).size()) #define rep(i,n) for(int i=0; i<(int)(n); i++) #define reps(i,n) for(int i=0; i<=(int)(n); i++) #define rrep(i,n) for(int i=(n-1); i>=0; i--) #define rreps(i,n) for(int i=(n); i>=0; i--) #define FOR(i,a,b) for(int i=a; i<(int)(b); i++) #define FOREQ(i,a,b) for(int i=a; i<=(int)(b); i++) #define RFOR(i,a,b) for(int i=a; i>(int)(b); i--) #define REP(i,n) for(int i=0, i##_len=(n); i bool chmin(T1 &a, T2 b) { return b < a && (a = b, true); } template bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); } void Main(); int main() { cin.tie(nullptr); ios_base::sync_with_stdio(false); cout << fixed << setprecision(15); cerr << fixed << setprecision(15); Main(); return 0; } void Main(){ // your code here! int N; cin >> N; vi64 A(N); rep(i,N) cin >> A[i]; sort(ALL(A)); vi32 dp(N+1,0); for(int i=N; i>=0; i--){ if(i+1