Highway Combinatorics
Time limit3sMemory limit1024 MB
Build a two-row parking layout of at most 200 columns whose empty cells can be tiled by 1x2 cars in exactly n ways modulo 1e9+7.
- Level
Medium7 of 10
- Topics
- Dynamic programming, Math, Implementation
- Solved
- No attempts yet
Problem
You are the new minister of transport in Berland. Recently, you allowed free parking on a two lane road segment of metres length. Since then, that road segment has constantly been jammed by parked cars due to some genius drivers who had the idea to park their cars across both lanes...
However, this is not your concern. You are more interested in parking some of your own cars on the road segment while it is empty. More specifically, you want to park some of your cars in such a way that the number of different ways to fill the remaining empty space with cars is congruent to your lucky number modulo .

Figure H.1: Visualization of Sample Output 1.
Each car has a size of metres. Each of the two lanes is metre wide and metres long. You own more than cars that you could park on the road segment.
Input
One line with one integer (), the desired number of possible ways to fill the road modulo .
It can be proven that at least one valid solution exists for each possible value of .
Output
Output the state of the two lanes in two lines. Print "#" for an occupied spot and "." for an empty spot. The two lines must have the same length, at least metre and at most metres. Each occupied spot must correspond to some parked car. If your solution uses a road segment shorter than metres, the remaining part of the road segment is assumed to be blocked by parked cars.