Fibonacci String
Medium
Execution time limit is 1 second
Runtime memory usage limit is 256 megabytes
The Fibonacci strings are defined as follows:
The first Fibonacci string is "a"
The second Fibonacci string is "bc"
The (n + 2)nd Fibonacci string is the concatenation of the two previous Fibonacci strings.
For example, the first few Fibonacci strings are
abcabcbcabcabcbcabc
The goal is, given a row and an offset, to determine what character is at that offset.
Input
Two integers separated by a space - K and P(0 < K ≤ 10^8), (0 < P ≤ 10^8), where K is the line number of the Fibonacci string and P is the position number in a row.
Output
The desired character for the relevant test: "a", "b" or "c". If P is greater than the Kth row (K ≤ 10^8), it is necessary to derive "No solution".
Examples
Input #1
Answer #1
Submissions 1K
Acceptance rate 10%