Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: Bestzu
Problemset: เดินทางไกล
Language: cpp
Time: 0.002 second
Submitted On: 2025-10-16 22:44:27
#include <bits/stdc++.h>
#define endl '\n'
using namespace std;
int main() {
ios::sync_with_stdio(false); cin.tie(nullptr);
int n, s; cin >> n >> s;
int smn = 0, smx = 0;
for(int i = 0; i < n; i++) {
int h; cin >> h;
if(h % 3 == 0 && h % 4 == 0) {
int lmax = 10*(h/3);
int lmin = 10*(h/4);
smx += lmax;
smn += lmin;
}
else if(h % 3 == 0) {
smx += 10*(h/3);
smn += 10*(h/3);
}
else if(h % 4 == 0) {
smx += 10*(h/4);
smn += 10*(h/4);
}
}
cout << s - smx << " " << s - smn << endl;
return 0;
}