A set of N numbers
(separated by one or more spaces) is passed as input to the program. The
program must identify the count of numbers where the number on the left is
twice the number on the right.
Input
Format:
The first line
will contain the N numbers separated by one or more spaces.
Boundary
Conditions: 3 <= N <= 50 The value of the numbers can be
from -99999999 to 99999999
Output
Format:
The count of
numbers where the sum of the numbers on the LHS is twice that of the sum of
numbers on the RHS.
Example
Input/Output 1:
Input:
10 20 5 40 15 -2
-30 -1 60
Output:
2
Explanation:
The numbers
meeting the criteria are 20, -30
Solution:
a,c=[int(i) for i
in input().split()],0
for i in
range(1,len(a)-1):
if
a[i-1]==2*a[i+1]:
c+=1
print(c)