P8691 [LQ Lanqiao Cup 2019 National C] Fill-in-the-Blank Problems

Description

## Task $\mathrm{A}$: Odd Multiple ### Problem Description Please find the smallest integer $X$ that satisfies both: - $X$ is a multiple of $2019$. - Every digit of $X$ is odd. ### Answer Submission This is a fill-in-the-blank (final answer) problem. You only need to compute the result and submit it. The result of this problem is an integer. When submitting, only fill in this integer; any extra content will make you score $0$. ## Task $\mathrm{B}$: Increasing Sequences ### Problem Description For a letter matrix, we say an increasing sequence in the matrix means finding two letters in the matrix such that they are in the same row, the same column, or on the same $45$-degree diagonal line, and when viewed from left to right, or from top to bottom, these two letters are in increasing order. For example, in the following matrix ``` LANN QIAO ``` there are $13$ increasing sequences: `LN`, `LN`, `AN`, `AN`, `IO`, `AO`, `LQ`, `AI`, `NO`, `NO`, `AQ`, `IN`, `AN`, etc. Note that when two letters are arranged from bottom-left to top-right, the order "from left to right" and "from top to bottom" are different orders. For the following matrix of $30$ rows and $50$ columns, how many increasing sequences are there in total? (If you copy the text below into a text file, be sure to check that the copied content is exactly the same as in the document. There is an attached file inc.txt whose content is the same as the text below.) ```plaintext VLPWJVVNNZSWFGHSFRBCOIJTPYNEURPIGKQGPSXUGNELGRVZAG SDLLOVGRTWEYZKKXNKIRWGZWXWRHKXFASATDWZAPZRNHTNNGQF ZGUGXVQDQAEAHOQEADMWWXFBXECKAVIGPTKTTQFWSWPKRPSMGA BDGMGYHAOPPRRHKYZCMFZEDELCALTBSWNTAODXYVHQNDASUFRL YVYWQZUTEPFSFXLTZBMBQETXGXFUEBHGMJKBPNIHMYOELYZIKH ZYZHSLTCGNANNXTUJGBYKUOJMGOGRDPKEUGVHNZJZHDUNRERBU XFPTZKTPVQPJEMBHNTUBSMIYEGXNWQSBZMHMDRZZMJPZQTCWLR ZNXOKBITTPSHEXWHZXFLWEMPZTBVNKNYSHCIQRIKQHFRAYWOPG MHJKFYYBQSDPOVJICWWGGCOZSBGLSOXOFDAADZYEOBKDDTMQPA VIDPIGELBYMEVQLASLQRUKMXSEWGHRSFVXOMHSJWWXHIBCGVIF GWRFRFLHAMYWYZOIQODBIHHRIIMWJWJGYPFAHZZWJKRGOISUJC EKQKKPNEYCBWOQHTYFHHQZRLFNDOVXTWASSQWXKBIVTKTUIASK PEKNJFIVBKOZUEPPHIWLUBFUDWPIDRJKAZVJKPBRHCRMGNMFWW CGZAXHXPDELTACGUWBXWNNZNDQYYCIQRJCULIEBQBLLMJEUSZP RWHHQMBIJWTQPUFNAESPZHAQARNIDUCRYQAZMNVRVZUJOZUDGS PFGAYBDEECHUXFUZIKAXYDFWJNSAOPJYWUIEJSCORRBVQHCHMR JNVIPVEMQSHCCAXMWEFSYIGFPIXNIDXOTXTNBCHSHUZGKXFECL YZBAIIOTWLREPZISBGJLQDALKZUKEQMKLDIPXJEPENEIPWFDLP HBQKWJFLSEXVILKYPNSWUZLDCRTAYUUPEITQJEITZRQMMAQNLN DQDJGOWMBFKAIGWEAJOISPFPLULIWVVALLIIHBGEZLGRHRCKGF LXYPCVPNUKSWCCGXEYTEBAWRLWDWNHHNNNWQNIIBUCGUJYMRYW CZDKISKUSBPFHVGSAVJBDMNPSDKFRXVVPLVAQUGVUJEXSZFGFQ IYIJGISUANRAXTGQLAVFMQTICKQAHLEBGHAVOVVPEXIMLFWIYI ZIIFSOPCMAWCBPKWZBUQPQLGSNIBFADUUJJHPAIUVVNWNWKDZB HGTEEIISFGIUEUOWXVTPJDVACYQYFQUCXOXOSSMXLZDQESHXKP FEBZHJAGIFGXSMRDKGONGELOALLSYDVILRWAPXXBPOOSWZNEAS VJGMAOFLGYIFLJTEKDNIWHJAABCASFMAKIENSYIZZSLRSUIPCJ BMQGMPDRCPGWKTPLOTAINXZAAJWCPUJHPOUYWNWHZAKCDMZDSR RRARTVHZYYCEDXJQNQAINQVDJCZCZLCQWQQIKUYMYMOVMNCBVY ABTCRRUXVGYLZILFLOFYVWFFBZNFWDZOADRDCLIRFKBFBHMAXX ``` ### Answer Submission This is a fill-in-the-blank (final answer) problem. You only need to compute the result and submit it. The result of this problem is an integer. When submitting, only fill in this integer; any extra content will make you score $0$. ## Task $\mathrm{C}$: Square Decomposition ### Problem Description Decompose $2019$ into a sum of several pairwise distinct perfect squares. How many different ways are there? Note that swapping the order is considered the same method. For example, $13^{2}+25^{2}+35^{2}=2019$ and $13^{2}+35^{2}+25^{2}=2019$ are considered the same method. ### Answer Submission This is a fill-in-the-blank (final answer) problem. You only need to compute the result and submit it. The result of this problem is an integer. When submitting, only fill in this integer; any extra content will make you score $0$. ## Task D: Optimal Travel ### Problem Description China's high-speed rail network is well connected and convenient to use, and Xiaoming often travels between cities by high-speed rail. Now, Xiaoming has another long vacation, and he plans to continue traveling by high-speed rail. This time, he plans to visit the following cities: Shanghai, Guangzhou, Changsha, Xi'an, Hangzhou, Jinan, Chengdu, Nanjing, Kunming, Zhengzhou, Tianjin, Taiyuan, Wuhan, Chongqing, Nanchang, Changchun, Shenyang, Guiyang, Fuzhou. Xiaoming plans to start from Beijing, visit each of the above cities exactly once, and finally return to Beijing. In each city (except Beijing), Xiaoming stays for at least $24$ hours. When Xiaoming decides to travel from one city to another, he only chooses cities that have a direct high-speed rail connection, and he will not transfer in the middle. The attached file trip.txt contains the train trips that Xiaoming can choose. Xiaoming will not choose other trips. Xiaoming departs at 12:00 noon on day $1$. How many minutes are needed at minimum for Xiaoming to visit each of the above cities exactly once and finally return to Beijing? (Note that the unit is minutes. Also note that in cities other than Beijing he must stay at least $24$ hours, i.e. at least $1440$ minutes.) ### Answer Submission This is a fill-in-the-blank (final answer) problem. You only need to compute the result and submit it. The result of this problem is an integer. When submitting, only fill in this integer; any extra content will make you score $0$. ## Task E: Dice Manufacturing ### Problem Description Dice are commonly used tools in games. A die is a regular hexahedron (cube). Its six faces are labeled with $1$ to $6$ pips, one of each. Usually, the pips from $1$ to $6$ look like the figure below. ![](https://luogu.oss-cn-hangzhou.aliyuncs.com/upload/vjudge_pic/lanqiao/2022_09_30_428d25a9985c915a8589g-05%5B1%5D.jpg) Among them, the shapes of $1$, $4$, and $5$ remain unchanged after rotations by $90^\circ$, $180^\circ$, or $270^\circ$, while the shapes of $2$, $3$, and $6$ remain unchanged after a $180^\circ$ rotation. Xiaoming wants to manufacture a batch of dice. He hopes they will be more interesting: he wants any two dice he makes to be different under rotation. What is the maximum number of dice he can make? ### Answer Submission This is a fill-in-the-blank (final answer) problem. You only need to compute the result and submit it. The result of this problem is an integer. When submitting, only fill in this integer; any extra content will make you score $0$.

Input Format

Input a capital letter indicating which task it is.

Output Format

Output the answer corresponding to the given task label.

Explanation/Hint

Answer template for reference. ```cpp #include using namespace std; int main() { string ans [] = { "The answer of task A", // Replace inside the double quotes with the answer to task A "The answer of task B", // Replace inside the double quotes with the answer to task B "The answer of task C", // Replace inside the double quotes with the answer to task C "The answer of task D", // Replace inside the double quotes with the answer to task D "The answer of task E", // Replace inside the double quotes with the answer to task E }; char T; cin >> T; cout