Skip to content

Instantly share code, notes, and snippets.

@monhime

monhime/ABC167B.gyp

Created May 10, 2020
Embed
What would you like to do?
ABC167 B問題 解答
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
a,b,_,k=map(int,input().split())
if k<=a:
print(k)
elif k>a and k<=a+b:
print(a)
else:
print(a-(k-a-b))
if __name__=='__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.