#P12404. 「CZOI-R3」可爱棉羊
「CZOI-R3」可爱棉羊
Problem Description
A farmer has lambs. They are kept in a single consecutive row of pens.
One day, 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 -th lamb is adjacent only to lambs and . In particular, the only adjacent lamb of lamb is , and the only adjacent lamb of lamb is .
After days (i.e. after 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 integers .
Output Format
Output 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 of the score for that test point. If you cannot output one of them, please use 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 .
[Constraints]
This problem uses bundled tests.
- Subtask #1 (): .
- Subtask #2 (): .
- Subtask #3 (): .
- Subtask #4 (): no special constraints.
For of the testdata, , .
Translated by ChatGPT 5