[백준] 10162 전자레인지

0

백준

목록 보기
245/271
post-thumbnail

[백준] 10162 전자레인지

#include <iostream>
#include <math.h>
using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);

	int T;
	cin >> T;

	int A, B, C;
	A = B = C = 0;

	//5분 = 300초
	A = T / 300;
	T -= (300 * A);
	//1분 = 60초
	B = T / 60;
	T -= (60 * B);
	//10초 
	C = T / 10;
	T -= (10 * C);

	if (T == 0) cout << A<<" "<<B<<" "<<C;
	else cout << -1;
	return 0;
}

profile
Be able to be vulnerable, in search of truth

0개의 댓글