Solved codeforces 460A in O(1)