Submission

Status:
PPPPPPPPPP

Score: 100

User: Winzzwz

Problemset: เดินทางไกล

Language: cpp

Time: 0.002 second

Submitted On: 2025-03-05 14:16:59

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int n,s,mn,mx;

int main() {
    cin.tie(0)->sync_with_stdio(0);
    cin >> n >> s;
    for (int i = 1; i <= n; i++) {
        int t; cin >> t;
        if (t%3 == 0 && t%4 == 0) {
            mn += 2*5*(t/4);
            mx += 2*5*(t/3);
        } else if (t%3 == 0) {
            mn += 2*5*(t/3);
            mx += 2*5*(t/3);
        } else {
            mn += 2*5*(t/4);
            mx += 2*5*(t/4);
        }
    }
    cout << s-mx << " " << s-mn;



    return 0;
}