Created
December 23, 2016 05:41
-
-
Save hiterm/d51367851194a11ef2011d230997a083 to your computer and use it in GitHub Desktop.
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
# 全ての点を通るので、 | |
# w, hに対して、距離は (w + 1)(h + 1) - 1 = wh + w + h になる | |
# 片方を固定して数え上げ | |
import math | |
n = int(input()) | |
s = 0 | |
i = 1 | |
while (n - i) // i + 1 >= 1: | |
s += (n - i) // (i + 1) | |
i += 1 | |
print(s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment