Accepted
Code
x,a,b,c,n=map(int,input().split())
p=[]
for i in range(201):
for j in range(201):
for k in range(201):
if x+(i*a)+(j*b)+(c*k)==n:
p.append((i+j+k))
if(len(p)>0):
print("YES")
print(min(p))
else:
print("NO")
Information
- Submit By
- Type
- Submission
- Problem
- P1028 Magical box and spell
- Language
- Python 3 (Python 3.12.3)
- Submit At
- 2024-04-02 08:09:30
- Judged At
- 2024-11-11 03:36:26
- Judged By
- Score
- 100
- Total Time
- 2452ms
- Peak Memory
- 3.133 MiB