Submission

Status:
PPPPP-P-P-

Score: 70

User: mister_o_hater_no1

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

Language: cpp

Time: 0.002 second

Submitted On: 2025-03-15 15:49:41

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

int main(){
	int n, mx, mnd, mxd, h;
	cin>> n>> mx;
	mxd= mx;
	mnd= mx;
	for(int i= 0; i< n; ++i){
		cin>> h;
		if(h% 12== 0){
			mnd-= 2*5*(h/3);
			mxd-= 2*5*(h/4);
		}
		else if(h% 3== 0){
			h/= 3;
			mxd-= 2*5*h;
			mnd= mxd;
		}
		else if(h% 4== 0){
			h/= 4;
			mxd-= 2*5*h;
			mnd= mxd;
		}
	}
	cout<< mnd<< " "<< mxd;
	
	return 0;
}