Created
November 4, 2015 18:15
-
-
Save popey456963/2d97723c1549152e8c30 to your computer and use it in GitHub Desktop.
Stepping Stones
This file contains hidden or 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 math | |
| start = int(input()) | |
| end = int(input()) | |
| amount = int(input()) - 1 | |
| if amount == -1 and start == 0 and end == 0: | |
| print("NONE") | |
| else: | |
| difference = end-start | |
| step = difference/amount | |
| c=[] | |
| for i in range(amount + 1): | |
| if start+i*step < 0: | |
| c.append(str(math.ceil(start+i*step))) | |
| else: | |
| c.append(str(math.floor(start+i*step))) | |
| print(" ".join(c)) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Different Format