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:01:03
- Judged At
- 2024-11-11 03:36:27
- Judged By
- Score
- 100
- Total Time
- 2538ms
- Peak Memory
- 3.137 MiB