- 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.
6 Respuestas
+ 1
Show your attempt first
+ 1
Manthan Verma Atleast you have tried right
0
If I know how to do that then why should I post it here
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
0
Okay I will try