Classroom Assignment
Time limit1sMemory limit1024 MB
Given N classrooms, pair them into floor(N/2) classes of two rooms each to find the maximum number of chocolate pies Jiwoong can receive.
- Level
Medium6 of 10
- Topics
- Dynamic programming, Bit manipulation
- Solved
- No attempts yet
Problem
Daegu Science High School is repairing its reading hall, so self-study is held in regular classrooms instead. The teachers worried that students would make noise, so they decided to give each class two classrooms. The rooms differ in size, so the teachers rotate the room assignments every day to share them fairly. The school has classrooms and classes. Each class is split into students with odd numbers and students with even numbers, and the two groups study in different classrooms.
Input
The first line contains an integer .
Output
Print the maximum number of chocolate pies Jiwoong can receive.
Constraints
Hints
- The maximum number of chocolate pies Jiwoong can receive does not exceed .
- If is odd, one classroom is left empty.
- is the greatest integer less than or equal to .