### 2010 Canadian Computing Competition, Stage 1

## Problem J1: What is `n`, Daddy?

Natalie is learning to count on her fingers. When her Daddy tells her a number `n`,
she asks “What is `n`, Daddy?”, by which she means “How many fingers should I hold up on each
hand so that the total is `n`?”
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.

For example, if Natalie asks “What is 4, Daddy?”, her Dad may reply:

- 4 is 4.
- 4 is 3 and 1.
- 4 is 2 and 2.

Your job is to make sure that Natalie’s Daddy gives the correct number of answers.

### Input Format

A single integer `n` (1 ≤ `n` ≤ 10).

### Output Format

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

### Sample Input

4

### Sample Output

3

All Submissions

Best Solutions

**Point Value:** 3

**Time Limit:** 2.00s

**Memory Limit:** 16M

**Added:** Feb 23, 2010

**Languages Allowed:**

C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

## Comments (Search)

DeboTessieon Jan 04, 2016 - 12:42:36 am UTC QuestionIt would be much appreciated!!

spencereiron Jan 04, 2016 - 2:29:35 am UTC Re: QuestionDeboTessieon Jan 05, 2016 - 1:56:39 am UTC Re: QuestionThanks!

spencereiron Jan 05, 2016 - 2:10:59 am UTC Re: QuestionDeboTessieon Jan 05, 2016 - 9:05:45 pm UTC Re: Questionvyom7777on Nov 03, 2015 - 2:58:35 am UTCwgma00on Nov 03, 2015 - 5:13:49 am UTC Re: ...jialeyuon Nov 02, 2015 - 1:52:05 am UTC So you just do it with your hands?jargonon Nov 02, 2015 - 4:15:27 am UTC Re: So you just do it with your hands?See zhxl0903's solution for an example of a formula that works for human hands, or HelloMelloC's solution for an example of a more generalisable solution involving loops.

thornstar2429on Mar 29, 2014 - 4:55:01 pm UTC Its not workingWilliamHon Mar 29, 2014 - 10:04:13 pm UTC Re: Its not workingthornstar2429on Mar 30, 2014 - 3:54:57 pm UTC Re: Its not workingsonictodd500on Mar 28, 2012 - 12:10:33 am UTC Brute force question?(by putting the input into an equation)

jargonon Mar 28, 2012 - 12:31:54 am UTC Re: Brute force question?sonictodd500on Mar 28, 2012 - 2:16:52 am UTC Re: Re: Brute force question?SourSpinachon Mar 28, 2012 - 4:48:00 pm UTC Re: Re: Brute force question?Alexon Mar 29, 2012 - 4:02:47 am UTC Re: Re: Brute force question?bbi5291on Apr 01, 2012 - 4:54:41 pm UTC Re: Re: Brute force question?helios26on Oct 04, 2012 - 11:16:54 pm UTC Re: Re: Brute force question?SourSpinachon Oct 07, 2012 - 9:26:26 pm UTC Re: Re: Brute force question?ilovepion Jan 18, 2011 - 12:20:50 am UTC WTH?bbi5291on Jan 18, 2011 - 1:27:44 am UTC Re: WTH?