On-line algorithms for q-adic covering of the unit interval and for covering a cube by cubes