Last active
February 26, 2020 16:51
-
-
Save yaraxxx/3fcfca069e3ccace4328d1049cd1aaae to your computer and use it in GitHub Desktop.
delivery Service
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
2 | |
3 | |
10 | |
20 | |
30 | |
2 | |
50 | |
100 |
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
def cal(orders , total=0): | |
if(orders == 0): | |
return total | |
else: | |
time = int(input()) | |
total += 2 * time | |
return cal(orders-1,total) | |
def main(): | |
t = int(input()) | |
for case in range(t): | |
Orders = int(input()) | |
time = cal(Orders) | |
print(case+1,".",time) | |
if __name__=="__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment