Killjee and simple problem

5

1 votes
Easy
Problem

killjee has an array A containing N integers. You need to find number of distinct values which are there in a special list prepared by Killjee using array A.

Special list of killjee contains sum of subarrays of array A.

Sum of subarray is sum of all elements in subarray

INPUT CONSTRAINTS

  • 1N1000
  • 1ai109

INPUT FORMAT

First line of input contains a single integer N, Next line contains N space separated integer Ai.

OUTPUT FORMAT

Print answer to the problem.

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

Killjee's list will contain 1,2,3,4

Editor Image

?