🔗문제 풀러가기
단계별로 풀어보기 단계 12의 6번째 문제이다.
#include <iostream>
using namespace std;
int main()
{
int n;
int cnt = 0;
cin >> n;
while (n >= 0)
{
if (n % 5 == 0)
{
cnt += (n / 5);
cout << cnt << endl;
return 0;
}
n -= 3;
cnt++;
}
cout << -1;
}