Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: dddrrrr

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

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-16 22:53:55

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

int main(){
	cin.tie(0)->sync_with_stdio(0);
	cout.tie(0)->sync_with_stdio(0);
	int n ,s;
	cin >> n >> s;
	
	int mx=0 ,mn=0;
	while(n--){
		int x;cin >> x;
		
		if(x%3 == 0 && x%4 == 0){
			int a = x/3;
			mx += (2*5*a);
			
			int b = x/4;
			mn += (2*5*b);
		}
		else if(x%3 == 0){
			x/=3;
			mx += (2*5*x);
			mn += (2*5*x);
		}
		else if(x%4 == 0){
			x/=4;
			mx += (2*5*x);
			mn += (2*5*x);
		}
		
		//cout << mx << ' ' << mn << "\n";
		
	}
	cout << s-mx << ' ' << s-mn;
	return 0; 
}