#include <iostream>
using namespace std;
int main(void)
{
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int input = 0;
cin >> input;
int y = 0;
int m = 0;
for (int i = 0; i < input; ++i)
{
int num = 0;
cin >> num;
int numY = num;
int numM = num;
while (numY >= 0)
{
numY -= 30;
y += 10;
}
while (numM >= 0)
{
numM -= 60;
m += 15;
}
}
if (y == m)
{
cout << "Y M " << y;
}
else if (y > m)
{
cout << "M " << m;
}
else
{
cout << "Y " << y;
}
return 0;
}
코딩 테스트