Created
May 10, 2020 23:40
-
-
Save monhime/6a7f3023ba616ac354ec5d6c7b02879d to your computer and use it in GitHub Desktop.
ABC167 B問題 解答
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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