base2i

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

Write a function P4:

  • Mr. Park ((1+6i)(1+6i) years old) has two eyes, so he loves 2i2i. He wants to advertise the base 2i2i system.

  • In the base 2i2i system, each complex number has the following representation: \[\cdots d_2d_1d_0.d_{-1}d_{-2}\cdots\] which means \[\cdots+d_2\cdot b^2+d_1\cdot b^1+d_0\cdot b^0+d_{-1}\cdot b^{-1}+d_{-2}\cdot b^{-2}+\cdots\] where b=2ib=2i, and d_k0,1,2,3d\_k\in\\{0,1,2,3\\} for each kk.

  • input parameter: two integers x, y satisfying max(\max(|x|,|y)106|)\le10^6

  • return value: the string representing the complex number x+i+iy in the base 2i2i system, satisfying the followings:

    • Each character in the string is one of '0', '1', '2', '3', '.'.
    • The string contains exactly one '.'.
    • There is exactly one character after '.'.
    • The string does not start with '.'.
    • The string does not start with '0' if there are more than one character before '.'.
  • For example, 31.0 is the base 2i2i representation of 1+6i1+6i since 1+6i=3(2i)1+1(2i)0+0(2i)11+6i=3\cdot(2i)^1+1\cdot(2i)^0+0\cdot(2i)^{-1}