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.