Constraints of this question are very high. later i got to know we can obtain answer in O(1) by using some formulae =(2nk-2n+2)/k; but i did not get this . can anybody explain me this formulae ?
Constraints of this question are very high. later i got to know we can obtain answer in O(1) by using some formulae =(2nk-2n+2)/k; but i did not get this . can anybody explain me this formulae ?