Help in a problem

Правка en1, от sourabh_jangid, 2020-09-05 07:32:43

You are given three numbers as input $$$A$$$, $$$B$$$, $$$K$$$.
Perform the given below steps K times:-
if $$$A$$$ <= $$$B$$$ then
$$$B$$$ = $$$B$$$ $$$-$$$ $$$A$$$
$$$A$$$ = $$$A$$$ $$$+$$$ $$$A$$$
else
$$$A$$$ = $$$A$$$ $$$-$$$ $$$B$$$
$$$B$$$ = $$$B$$$ $$$+$$$ $$$B$$$

After K steps output the values of $$$A$$$ and $$$B$$$.
$$$0$$$ $$$\leq$$$ $$$A$$$, $$$B$$$ $$$\leq$$$ $$$10 ^ {9}$$$
$$$1$$$ $$$\leq$$$ $$$K$$$ $$$\leq$$$ $$$10 ^ {10}$$$.
If someone can give some hints it will be helpful.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский sourabh_jangid 2020-09-05 07:32:43 1549 Initial revision (published)