Special numbers
Practice
1 (1 votes)
String
Basics of bit manipulation
Basic programming
Bit manipulation
Basics of bit manipulation
Logic Based
Easy
Bit manipulation
Problem
41% Success 34 Attempts 30 Points 1s Time Limit 256MB Memory 1024 KB Max Code

Alice is traveling to a special town with her friends. All the residents of this special town communicate through a special language. This special language consists of \(4\) special alphabets \(a,b,c\) and \(d\). This language contains special words. These words are composed of these \(4\) special alphabets and are always even in length. The words are always palindromic in nature. The words are also assigned special numbers. A special number is the lexicographical rank of special word with respect to other special words. 

You are given a special number. Your task is to determine the special word corresponding to that special number. 

Note: A palindrome sequence that reads the same backward as forwards. For example, \(aaaa\)\(abba\), and so on.

Input format

  • First line: A single integer \(T\) denoting the number of test cases
  • For each test case: 
    • First line: A single integer \(k\) denoting the special number

Output format

For each test case, print a string that denotes the special number corresponding to the special number in a new line.

Constraints

\(1 \le T \le 10^5\)

\(1 \le k \le 10^9\)

 

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
11 votes
Tags:
AlgorithmsApprovedMathMediumOpen
Points:20
126 votes
Tags:
AlgorithmsApprovedBinary search treeEasyOpenSetsSortingTrees
Points:20
58 votes
Tags:
AlgorithmsDynamic Programming