/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
public static double power(double x, int n) {
if (n == 0) return 1;
if (n == 1) return x;
double pHalf = power(x, n/2);
if (n%2 == 0) {
return pHalf*pHalf;
} else {
return x*pHalf*pHalf;
}
}
for (int i = 0 ; i != 20 ; i++)
System.
out.
println(power
(2, i
)); }
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKICAgIHB1YmxpYyBzdGF0aWMgZG91YmxlIHBvd2VyKGRvdWJsZSB4LCBpbnQgbikgewogICAgCWlmIChuID09IDApIHJldHVybiAxOwogICAgCWlmIChuID09IDEpIHJldHVybiB4OwoJCWRvdWJsZSBwSGFsZiA9IHBvd2VyKHgsIG4vMik7CiAgICAJaWYgKG4lMiA9PSAwKSB7CiAgICAgICAgICAgIHJldHVybiBwSGFsZipwSGFsZjsKICAgIAl9IGVsc2UgewogICAgICAgICAgICByZXR1cm4geCpwSGFsZipwSGFsZjsKICAgIAl9CiAgICB9CglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbiAoU3RyaW5nW10gYXJncykgdGhyb3dzIGphdmEubGFuZy5FeGNlcHRpb24gewoJCWZvciAoaW50IGkgPSAwIDsgaSAhPSAyMCA7IGkrKykKCQkJU3lzdGVtLm91dC5wcmludGxuKHBvd2VyKDIsIGkpKTsKCX0KfQ==