Problem:


領域の数

無限に広い平面の上に、無限に長い直線を数本引くと、この平面はいくつかの領域に分割されます。たとえば、直線を１本引くと、平面は２つの領域に分割されます。同じ数の直線を引いても、引き方によって得られる領域の数は異なります。たとえば、2 本の直線を平行に引けば得られる領域は 3 つになり、互いに垂直に引けば得られる領域は 4 つになります。

n 本の直線を引くことで得られる最大の領域の数を出力するプログラムを作成してください。

Input

複数のデータセットが与えられます。各データセットに n (1 ≤ n ≤ 10,000) が１行に与えられます。入力の最後まで処理して下さい。

データセットの数は 50 を超えません。

Output

各データセットに対して、最大の分割数を１行に出力して下さい。

Sample Input

1
3

Output for the Sample Input

2
7



Sample input:
1
3


Sample output:
2
7

Submission status: Wrong Answer

Solution code:
while True:
    try:
        a = int(input())
        print(((a * a) + a + 2) / 2)
    except EOFError:
        break

Submission status: Wrong Answer

Solution code:
while True:
    try:
        a = int(input())
        print(str(((a * a) + a + 2) / 2))
    except EOFError:
        break

Submission status: Wrong Answer

Solution code:
d= dict()
j=v= 2

for i in range(1, 10001):
    d[i]= v
    if i%2==0: j+= 1
    v+= j

while True:
    try:
        l= int(input())
    except:
        break
    print(d[l])

Submission status: Wrong Answer

Solution code:
import sys


def solve(n):
  if n == 0:
    return 1
  else:
    return n + solve(n - 1)


for line in sys.stdin:
  try:
    n = int(line)
    print(solve(n))
  except:
    break

Submission status: Accepted

Solution code:
import sys
for n in map(int, sys.stdin):
    print(n*(n+1)//2+1)

Submission status: Accepted

Solution code:
while True:
	try:
		x = int(input())
		print(int((x**2 + x + 2) / 2))
	except:
		break

Submission status: Accepted

Solution code:
while True:
    try:
        n = int(input())
    except:
        break
    ans = 2
    for i in range(2, n + 1):
        ans += i
    print(ans)

Submission status: Accepted

Solution code:
import sys
n = 10001
l = [0]*n
l[2] = 1
for i in xrange(3,n): l[i] = (i-1)+l[i-1]
for i in xrange(1,n): l[i] += i+1
for s in sys.stdin:
    d = int(s)
    print l[d]

Submission status: Accepted

Solution code:
#! /usr/bin/python
# -*- coding: utf-8 -*-

def main():
    # input
    while(True):
        try:
            data = int(raw_input())
            print(countArea(data))
        except EOFError:
            break

def countArea(n):
    ans = 2
    while(n > 1):
        ans = ans + n
        n -= 1

    return ans

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
import sys
f = sys.stdin

for n in f:
    n = int(n)
    print(n * (n + 1) // 2 + 1)

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-

while True:
	try:
		n = int(raw_input())
		print (n * n + n + 2) / 2
	except:
		break

Submission status: Accepted

Solution code:
while True:
    try:
        n = int(input())
    except:
        break

    sum = 1
    for i in range(1, n + 1):
        sum += i

    print(sum)

Submission status: Accepted

Solution code:
while True:
    try:
        n=int(raw_input())
    except EOFError:
        break
    print n*(n+1)/2+1

Submission status: Accepted

Solution code:
import sys
for line in sys.stdin.readlines():
  n = int(line)
  i = (1+n)*n//2+1
  print(i)

Submission status: Accepted

Solution code:
while 1:
    try:
        n=int(raw_input())
        ans=1
        for i in range(1,n+1):
            ans=ans+i
        print ans
    except:
        break

Submission status: Accepted

Solution code:
while True:
	try:
		n=int(input())
		a=2
		d=2
		for i in range(n-1):
			a+=d
			d+=1
		print(a)
	except EOFError:
		break

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys

for line in sys.stdin:
    n = int(line)
    print (n*n+n+2)/2

Submission status: Accepted

Solution code:
while True:
    try:
        n = int(input())
    except:
        break
    print(n * (n + 1) // 2 + 1)

Submission status: Accepted

Solution code:
while True:
    try:
        a = int(input())
        print(str(int(((a * a) + a + 2) / 2)))
    except EOFError:
        break

Submission status: Accepted

Solution code:
while True:
    try:
        n = int(input())
        ans = 2 + (n + 2)*(n - 1) / 2
        print(int(ans))
    except EOFError:
        break

Submission status: Accepted

Solution code:
while 1:
    try:n=int(input())
    except:break
    print((n*n+n+2)//2)

Submission status: Accepted

Solution code:
while True:
    try:
        n=int(input())
    except:
        break
    print(n * (n + 1) // 2 + 1)

Submission status: Accepted

Solution code:
while True:
    try:
        l= int(input())
    except:
        break
    print((l**2+l+2)//2)

Submission status: Accepted

Solution code:
import sys
for i in sys.stdin.readlines():
    a = 2
    for i2 in range(2,int(i)+1):
        a += i2
    print(a)

Submission status: Accepted

Solution code:
while True:
    try:
        N = int(input())
    except EOFError:
        break
    print(1 + sum(range(N + 1)))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

import sys
import os

for s in sys.stdin:
    n = int(s)
    if n == 1:
        print(2)
    else:
        num = 2
        for i in range(2, n+1):
            num += i
        print(num)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0057
"""
import sys


Area_memo = [0 for _ in range(10002)]         #  n??¬???????????????????????????????????° (0???????¨????)
Area_memo[0] = 1
def count_area(num):
    """
    ????????°??¨???????????°?????¢????????\????????????????????£????????????
    0 -> 1
    1 -> 2
    2 -> 4
    3 -> 7
    4 -> 11
    ?????£??????i??¬???????????????????????????????????°??????(i-1)??¬????????????????????° + ????????° ??¨?????????
    n?????°????????§??§10,000????????§????????¢???????????????????????????
    ??? ?????????????????¨???n?????§????????¨?????°????????????????????°????¢???????????????¨???????????????
    :param num:????????°
    :return: ???????????°
    """
    global Area_memo
    if Area_memo[num] == 0:
        Area_memo[num] = num + count_area(num-1)
    return Area_memo[num]


def count_area2(num):
    wa = num * (1 + num) // 2
    return wa + 1



def main(args):
    for line in sys.stdin:
        num = int(line.strip())
        result = count_area2(num)
        print(result)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
# Aizu Problem 0057: Number of Area
#
import sys, math, os, bisect

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


for line in sys.stdin:
    n = int(line)
    print(1 + n * (n + 1) // 2)

Submission status: Accepted

Solution code:
import sys

for line in sys.stdin:
  try:
    n = int(line)
    print((n**2 + n + 2) // 2)
  except:
    break

Submission status: Accepted

Solution code:
while True:
    try:
        n = int(input())
        print((n**2 + n + 2)//2)
    except:
        break

Submission status: Accepted

Solution code:
def get_input():
    while True:
        try:
            yield ''.join(input())
        except EOFError:
            break

N = list(get_input())
for l in range(len(N)):
    n = int(N[l])
    print(n*(n+1)//2+1)

Submission status: Accepted

Solution code:
import sys
for e in sys.stdin:e=int(e);print(e*(e+1)//2+1)

Submission status: Accepted

Solution code:
while True:
  try:
    n = int(input())
    print(1 + n * (n + 1) // 2)

  except EOFError:
    break

Submission status: Accepted

Solution code:
import sys
lc=lambda n:int((n**2+n+2)/2)
[print(i) for i in [lc(int(j)) for j in sys.stdin]]

Submission status: Accepted

Solution code:
# AOJ 0057 The Number of Area
# Python3 2018.6.16 bal4u

while True:
	try: n= int(input())
	except: break
	print(1+n*(n+1)//2)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# coding: utf-8

import sys


def get_answer(param):
    answer = 1
    for i in xrange(1, param + 1):
        answer += i
    return answer


def main():
    params = [int(line) for line in sys.stdin.readlines()]
    for param in params:
        print get_answer(param)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
N=10000+1
d=[0]*N
d[0]=1
for i in xrange(1,N):
    d[i]=d[i-1]+i
for line in sys.stdin.readlines():
    print d[int(line.strip())]

Submission status: Accepted

Solution code:
import sys


a = [1]
for i in range(1, 10001):
  a.append(a[-1] + i)

for line in sys.stdin:
    n = int(line)
    print a[n]

Submission status: Accepted

Solution code:
while True:
    try:
        a = int(raw_input())                                                                                                                                                                                 

        print (a**2+a+2)/2

    except EOFError: break

Submission status: Accepted

Solution code:
import sys
dp=[0]*10001
for line in sys.stdin.readlines():
    n = int(line)
    dp[0]=1
    for i in range(1,n+1):
        dp[i]=dp[i-1]+i
    print dp[n]

Submission status: Accepted

Solution code:
import sys
for line in sys.stdin.readlines():
    n = int(line)
    dp=1
    for i in range(1,n+1):
        dp+=i
    print dp

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (division, absolute_import, print_function,
                        unicode_literals)
from sys import stdin

L = [1]
for i in xrange(1, 10001):
    L.append(i + L[-1])

for line in stdin:
    n = int(line)
    print(L[n])

Submission status: Accepted

Solution code:
import sys

for s in sys.stdin:
    n = int(s)
    print (n * n + n + 2) / 2

Submission status: Accepted

Solution code:
import sys
for n in sys.stdin:
    n=int(n)
    print n*(n+1)/2+1

Submission status: Accepted

Solution code:
while True:
    try:
        n = int(raw_input())
        area = 2
        for i in range(n-1):
            area += i+2
        print area
    except:
        break

Submission status: Accepted

Solution code:
while True:
    try:
        n = int(raw_input())
        print 1 + n*(n+1)/2
    except:
        break

Submission status: Accepted

Solution code:
try:
    a = range(10010)
    a[0] = 1
    for i in range(1, len(a)):
            a[i] += a[i - 1]
    while True:
        print a[int(raw_input())]
except EOFError:
    pass

Submission status: Accepted

Solution code:
while 1:
    try:
        n = input()
    except EOFError:
        break
    ret = 1
    for i in xrange(1, n + 1):
        ret += i
    print ret

Submission status: Accepted

Solution code:
while True:
    try:
        n = int(input())
        print((1+n)*n//2 + 1)
    except:
        break

Submission status: Accepted

Solution code:
an = [1]
for i in range(1, 10001):
    an.append(an[i-1] + i)

while True:
    try:
        n = int(input())
    except:
        break
    print(an[n])

Submission status: Accepted

Solution code:
while True :
    try :
        n = int(input())
    except EOFError :
        break
    
    m = n*(n+1)//2 + 1
    print(m)

Submission status: Accepted

Solution code:
import sys
readlines = sys.stdin.readlines
write = sys.stdout.write
def solve():
    for line in readlines():
        N = int(line)
        write("%d\n" % (N*(N+1)//2+1))
solve()

Submission status: Accepted

Solution code:

def search(n):
    return (1+n*(n+1)//2)

while True:
    try:
        n=int(input())
    except:
        break
    #print(count(n))
    print(search(n))

Submission status: Accepted

Solution code:
while 1:
    try:
        n = int(input())
    except:break
    ans = (0.5 * n * n) + (0.5 * n) + 1        
    print(round(ans))

Submission status: Accepted

Solution code:
a = [1]
for i in range(1, 10002):
    a.append(a[i-1]+i)
while True:
    try:
        print(a[int(input())])
    except:
        break

Submission status: Accepted

Solution code:
while 1:
    try:
        n = int(input())
        print(int(2+(n - 1) * (n + 2)*0.5))
    except:
        break

Submission status: Accepted

Solution code:
import sys
for e in sys.stdin:e=int(e);print(e*(e+1)//2+1)

Submission status: Accepted

Solution code:
# coding=utf-8

###
### for python program
###

import sys
import math

# math class
class mymath:
    ### pi
    pi = 3.14159265358979323846264338

    ### Prime Number
    def pnum_eratosthenes(self, n):
        ptable = [0 for i in range(n+1)]
        plist = []

        for i in range(2, n+1):
            if ptable[i]==0:
                plist.append(i)
                for j in range(i+i, n+1, i):
                    ptable[j] = 1
        return plist

    def pnum_check(self, n):
        if (n==1):
            return False
        elif (n==2):
            return True
        else:
            for x in range(2,n):
                if(n % x==0):
                    return False
            return True

    ### GCD
    def gcd(self, a, b):
        if b == 0:
            return a
        return self.gcd(b, a%b)

    ### LCM
    def lcm(self, a, b):
        return (a*b)//self.gcd(a,b)

    ### Mat Multiplication
    def mul(self, A, B):
        ans = []
        for a in A:
            c = 0
            for j, row in enumerate(a):
                c += row*B[j]
            ans.append(c)
        return ans

mymath = mymath()

### output class
class output:
    ### list
    def list(self, l):
        l = list(l)
        #print(" ", end="")
        for i, num in enumerate(l):
            print(num, end="")
            if i != len(l)-1:
                print(" ", end="")
        print()

output = output()

### input sample
#i = input()
#N = int(input())
#A, B, C = [x for x in input().split()]
#N, K = [int(x) for x in input().split()]
#inlist = [int(w) for w in input().split()]

#R = float(input())
#A.append(list(map(int,input().split())))

#for line in sys.stdin.readlines():
#    x, y = [int(temp) for temp in line.split()]

#abc list
#abc = [chr(ord('a') + i) for i in range(26)]

### output sample
# print("{0} {1} {2:.5f}".format(A//B, A%B, A/B))
# print("{0:.6f} {1:.6f}".format(R*R*math.pi,R*2*math.pi))
# print(" {}".format(i), end="")

# def printA(A):
#     for i, n in enumerate(A):
#         print(n, end='')
#         if i != N-1:
#             print(' ', end='')
#     print()

# リスト内包表記 ifあり
# [x-k if x != 0 else x for x in C]

# ソート
# N = N.sort()

# 10000個の素数リスト
# P = mymath.pnum_eratosthenes(105000)

def is_integer(n):
    try:
        float(n)
    except ValueError:
        return False
    else:
        return float(n).is_integer()

def dist(A, B):
    d = 0
    for i in range(len(A)):
        d += (A[i]-B[i])**2            
    d = d**(1/2)
    return d

def get_input():
    N = []
    while True:
        try:
            #N.append(input())
            N.append(int(input()))
            #N.append(float(input()))
        except EOFError:
            break
    return N

N = get_input()

for n in N:
    ans = 2
    for i in range(2,n+1):
        ans += i
    print(ans)

Submission status: Accepted

Solution code:
while True:
    try:
        l= int(input())
    except:
        break
    print((l**2+l+2)//2)

Submission status: Accepted

Solution code:
while 1:
    try:
        n=int(input())
        print(int(n*(n+1)/2)+1)
    except:break

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(100000)

while(1):
    try:
        n = int(input())
        print(int((n**2+n+2)/2))
    except EOFError:
        break

Submission status: Accepted

Solution code:
while 1:
    try:
        n = int(input())
    except:
        break

    ans = (n ** 2 + n + 2) // 2
    print(ans)

Submission status: Accepted

Solution code:
while(True):
    try: n = int(input())
    except: break
    print(1+sum([i+1 for i in range(n)]))

Submission status: Accepted

Solution code:
import sys
for i in sys.stdin:
    print(int(i)*(int(i)+1)//2+1)

Submission status: Runtime Error

Solution code:
#! /usr/bin/python
# -*- coding: utf-8 -*-

def main():
    # input
    while(True):
        try:
            data = int(raw_input())
            print(countArea(data))
        except EOFError:
            break

def countArea(n):
    if n == 1:
        return 2
    else:
        return countArea(n-1) + n
        
if __name__=='__main__':
    main()

Submission status: Runtime Error

Solution code:
import sys
z=10001
a=[0]*z
a[2] = 1
for i in xrange(3,z):a[i]=(i-1)+l[i-1]
for j in xrange(1,z):a[j]+=j+1
for s in sys.stdin:
    d=int(s)
    print a[d]

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0057
"""
import sys


Area_memo = [0 for _ in range(10002)]         #  n??¬???????????????????????????????????° (0???????¨????)
Area_memo[0] = 1
def count_area(num):
    """
    ????????°??¨???????????°?????¢????????\????????????????????£????????????
    0 -> 1
    1 -> 2
    2 -> 4
    3 -> 7
    4 -> 11
    ?????£??????i??¬???????????????????????????????????°??????(i-1)??¬????????????????????° + ????????° ??¨?????????
    n?????°????????§??§10,000????????§????????¢???????????????????????????
    :param num:????????°
    :return: ???????????°
    """
    global Area_memo
    if Area_memo[num] == 0:
        Area_memo[num] = num + count_area(num-1)
    return Area_memo[num]


def main(args):
    for line in sys.stdin:
        num = int(line.strip())
        result = count_area(num)
        print(result)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Runtime Error

Solution code:
import sys
lc=lambda n:int((n**2+n+2)/2)
[print(i) for i in [lc(int(j)) for j in sts.stdin]]

Submission status: Runtime Error

Solution code:
while True:
    try:
        n = int(raw_input())                                                                                                                                                                                 

        print (a**2+a+2)/2

    except EOFError: break
~

Submission status: Runtime Error

Solution code:
while True:
    try:
        n = int(raw_input())                                                                                                                                                                                 

        print (a**2+a+2)/2

    except EOFError: break