Array ( [0] => [1] => questions [2] => Arrays [3] => Harmonic-Progression ) Arrays | Harmonic Progression | THE INQUISITIVE





Harmonic Progression

LEVEL:Beginner

Description

Given list of elements. You have to find the sum of elements which are in HP.

Input Format

First line contains a number N. Next line contains N integers separated by spaces.

Output Format

Print the resultant sum value.


Example 1:

Input
5
1 1/2 1/3 1/4 1/5
Output
2
Example 2:

Input
7
1/2 1/4 1/6 1/8 1/10 1/12 1/14
Output
1
Example 3:

Input
5
1 1/4 1/7 1/10 1/13
Output
2

oops

Login to see Discussion




Approach

0


Note :

Let us know if you can come up with a better approach, mail us at support@theinquisitive.in Your approach will be reviewed and posted with credits to you.

oops

Login to see Solution