https://www.acmicpc.net/problem/11659아이디어1~n번째까지의 합을 totaln에 담았다.이러한 방식으로 총합을 구하는 것을 Prefix Sum 알고리즘이라고 한다.