#include <iostream> #include <cmath> using namespace std; double g(double v) {return floor(v + .2);} int main() { double c = 1000. / sqrt(sqrt(2.)); for (int ic = 0; ic <= 10; ++ic, c /= sqrt(2.)) { std::cout << "[A" << ic << ':' << g(c) << ' ' << g(sqrt(2.) * c) << "], " "[B" << ic << ':' << g(sqrt(3. / 2.) * c) << ' ' << g(sqrt(3.) * c) << "]\n"; } return 0; }
Standard input is empty
[A0:841 1189], [B0:1030 1456] [A1:594 841], [B1:728 1030] [A2:420 594], [B2:515 728] [A3:297 420], [B3:364 515] [A4:210 297], [B4:257 364] [A5:148 210], [B5:182 257] [A6:105 148], [B6:128 182] [A7:74 105], [B7:91 128] [A8:52 74], [B8:64 91] [A9:37 52], [B9:45 64] [A10:26 37], [B10:32 45]