#P13673. [GCPC 2023] Highway Combinatorics

    ID: 15497 远端评测题 3000ms 1024MiB 尝试: 0 已通过: 0 难度: 6 上传者: 标签>2023数论Special JudgeFibonacci 数列随机化ICPC折半搜索 meet in the middle

[GCPC 2023] Highway Combinatorics

题目描述

You are the new minister of transport in Berland. Recently, you allowed free parking on a two lane road segment of 200200 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...

:::align{center} Jam caused by parking bus, Nevermind2 :::

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 nn modulo 109+710^9+7.

:::align{center} Figure H.1: Visualization of Sample Output 1. :::

Each car has a size of 1×21\times2 metres, each of the two lanes is 11 metre wide and 200200 metres long. You own more than 200200 cars which you could park on the road segment.

输入格式

The input consists of:

  • One line with one integer nn (0n<109+70\leq n<10^9+7), the desired number of possible ways to fill the road modulo 109+710^9+7.

It can be proven that at least one valid solution exists for each possible value of nn.

输出格式

Output the state of the two lanes in two lines. Print "#\texttt{\#}" for an occupied spot and ".\texttt{.}" for an empty spot. Note that the two lines should have the same length of at least 11 metre and at most 200200 metres, and the occupied spots must correspond to some parked cars. If your solution uses a road segment shorter than 200200 metres, the remaining part of the road segment is assumed to be blocked by parked cars.

10
##..#.......
....#.##....
27
...##........
........##...