#P12404. 「CZOI-R3」可爱棉羊

    ID: 13464 远端评测题 1000ms 512MiB 尝试: 0 已通过: 0 难度: 3 上传者: 标签>数学贪心洛谷原创Special JudgeO2优化洛谷比赛

「CZOI-R3」可爱棉羊

Problem Description

A farmer has NN lambs. They are kept in a single consecutive row of NN pens.

One day, xx different lambs got sick. Every night, each lamb that is already infected will randomly infect one of its adjacent lambs. Also, the same lamb may be infected multiple times.

The ii-th lamb is adjacent only to lambs i1i-1 and i+1i+1. In particular, the only adjacent lamb of lamb 11 is 22, and the only adjacent lamb of lamb NN is N1N-1.

After TT days (i.e. after TT rounds of infection), the farmer finally discovers this. He is very anxious and urgently wants to know: among all possible situations, what are the maximum and minimum possible numbers of infected lambs now.

Input Format

The first line contains 33 integers N,T,xN, T, x.

Output Format

Output 22 integers in the first line, representing the maximum and minimum possible numbers of infected lambs.

If at least one number in your output is correct, you will get 50%50\% of the score for that test point. If you cannot output one of them, please use 00 instead, otherwise you will not get any points.

2 3 1
2 2
7 2 3
7 3

Hint

[Sample Explanation #1]

After the first round of infection, both lambs will be infected, so the maximum and minimum numbers of infected lambs are both 22.

[Constraints]

This problem uses bundled tests.

  • Subtask #1 (20 pts20\text{ pts}): N,T20N, T \le 20.
  • Subtask #2 (20 pts20\text{ pts}): N20N \le 20.
  • Subtask #3 (20 pts20\text{ pts}): x=1x = 1.
  • Subtask #4 (40 pts40\text{ pts}): no special constraints.

For 100%100\% of the testdata, 2N,T1092 \le N, T \le 10^9, 1xN1 \le x \le N.

Translated by ChatGPT 5