사생활 보호 설정
https://gamjia.tistory.com
Updated News
Mini Rooms
답글수 [0]
What Friends Say
한마디로 표현해봐~
1촌평 관리
2839번 설탕 배달
GamJia 2023. 3. 29. 20:09
단계별로 풀어보기 - 기본 수학 1 - 7단계
https://www.acmicpc.net/problem/2839
#include <iostream> using namespace std; int main() { int N; cin>>N; for(int i=N/5;i>=0;i--) { for(int j=0;j<=(N-5*i)/3;j++) { if(N==(i*5+j*3)) { cout<<i+j; return 0; } } } cout<<"-1"; return 0; }