[BOJ 9705] CHARITY BOOTH RENTAL

View as PDF

Submit solution

Points: 2
Time limit: 1.0s
Memory limit: 128M

Problem types
Allowed languages
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text

The Kajang Municipal Council is organising a fundraising event to raise money for charity. The council plans to provide booth spaces for rent to government agencies (GA), private companies (PC) and the general public (GP) who wish to participate in that event. The organiser has decided to allocate booth spaces as follows:</p>

0 < booth spaces for GP < booth spaces for GA < booth spaces for PC

As an example, for 10 booth spaces, the following allocations are possible

GP =1, GA =2, PC =7
GP =1, GA =3, PC =6
GP =1, GA =4, PC =5
GP =2, GA =3, PC =5

Write a program to calculate the number of possible allocations given the number of booth spaces.

입력 형식

Each case is the number of booth spaces T where 6 <= T <= 1000000. The input is terminated with a 0. 

출력 형식

For each test case, the output contains a line in the format Case #x: M, where x is the case number (starting from 1) and M is the number of booth spaces and the answer with a colon (':') separating them. The output for each case must be printed on a separate line.

예제 입력

8
10
0

예제 출력

Case #1: 8:2
Case #2: 10:4

Comments

There are no comments at the moment.