Company: Deloitte Analyst role Off-campus_9may
Difficulty: medium
Given an integer N, a list of N positive numbers, and a value V. Write a program that prints the position at which the cumulative sum of elements in the list from the first position exceeds or equals to the given value V. Read the input from STDIN and print the output to STDOUT. Do not write any message strings while reading the input or while printing the output as they contribute to the standard output. Constraints: i) 2 ≤ N ≤ 5000 ii) 1 ≤ Elements in the list ≤ 50000 iii) 1 ≤ Value V ≤ 10 9 iv) Position starts from 1. v) Each test case has a position at which the cumulative sum of elements exceeds or equal to value V. Input format: The first line of input consists of an integer N. The second input line will consist of N integers separated by a single white space. The third line of input consists of a value V. Output format: The only line of output should display the position at which the cumulative sum of elements in the list from the first position exceeds or equals to V. Sample In