- 2

Number Game

You are given a Integer N and array of size 2N .You have to find the gcd(num1 , num2)*round number where num1 and num2 will be positive Integer from array and round number will be the number of rounds you will calculate which is equal to Integer N. First line will be Integer N Second line will array elements of Size 2N For example 2 3 4 9 5 Output-7 Explanation First round gcd(4,5)*1=1*1=1 Second round gcd(3,9)*2=3*2=6 Sum=1+6=7 For example 3 8 6 5 6 25 16 First round gcd(5,25)*1=5*1=5 Second round gcd(6,6)*2=6*2=12 Third round gcd(8,16)*3=8*3=24 Sum=5+12+24=41.

23rd Mar 2021, 6:06 AM
Manthan Verma
Manthan Verma - avatar
6 Respuestas
+ 1
Show your attempt first
23rd Mar 2021, 6:07 AM
Atul [Inactive]
+ 1
Manthan Verma Atleast you have tried right
23rd Mar 2021, 6:18 AM
R🍁🇮🇳
R🍁🇮🇳 - avatar
0
If I know how to do that then why should I post it here
23rd Mar 2021, 6:08 AM
Manthan Verma
Manthan Verma - avatar
0
Manthan Verma Because Q&A is not a place to ask for a solution of an assignment. https://www.sololearn.com/discuss/333866/?ref=app
23rd Mar 2021, 6:14 AM
你知道規則,我也是
你知道規則,我也是 - avatar
0
Okay I will try
23rd Mar 2021, 6:51 AM
Manthan Verma
Manthan Verma - avatar