Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a=int(input())
- b=int(input())
- n=int(input())
- m=int(input())
- if(a<b and m>n):
- print(-1)
- elif(a>b and m<n):
- print(-1)
- else:
- if(a>b):
- minTime=1+a*(n-1)+1
- maxTime=a*n+n-1
- else:
- minTime=1+b*(m-1)+1
- maxTime=b*m+m-1
- print(minTime, maxTime)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement