## CCC '10 J1 - What is n, Daddy?

View as PDF

Points: 3
Time limit: 2.0s
Memory limit: 64M

Problem type
##### Canadian Computing Competition: 2010 Stage 1, Junior #1

Natalie is learning to count on her fingers. When her Daddy tells her a number (), she asks "What is , Daddy?", by which she means "How many fingers should I hold up on each hand so that the total is ?"

To make matters simple, her Daddy gives her the correct finger representation according to the following rules:

• the number may be represented on one or two hands;
• if the number is represented on two hands, the larger number is given first.

• is .
• is and .
• is and .

#### Input Specification

The input will be a single integer such that .

#### Output Specification

The output is the number of ways of producing that number on two hands, subject to the rules outlined above.

#### Sample Input

4

#### Output for Sample Input

3

• MichaelR984  commented on Nov. 9, 2017, 8:45 p.m.

@epic1online that was a very helpful comment thanks

• CarolChen  commented on Feb. 15, 2016, 11:55 a.m. edited
Fingers.

Could not figure out what I was doing wrong then I remembered we have only 5 fingers.

• MakanDey  commented on Feb. 22, 2018, 11:29 a.m.

Oh darn I thought I had 40.

• retronerd2016  commented on Nov. 2, 2017, 5:52 p.m.

wait hold on the example says 3, what does 3 mean

• xxsc  commented on July 3, 2018, 11:19 p.m. edited

3 is the number of ways to show 4.

4 is 4 is one way.

4 is 3 and 1 is another.

4 is 2 and 2 is the last one, because saying 4 is 1 and 3 would be the same as saying 4 is 3 and 1. Same goes with 4 is 0 and 4.

EDIT: