🏡 index : github.com/captn3m0/codechef.git

---
category_name: easy
problem_code: LTM40CD
problem_name: 'Chef and Triangles'
languages_supported:
    - ADA
    - ASM
    - BASH
    - BF
    - C
    - 'C99 strict'
    - CAML
    - CLOJ
    - CLPS
    - 'CPP 4.3.2'
    - 'CPP 4.9.2'
    - CPP14
    - CS2
    - D
    - ERL
    - FORT
    - FS
    - GO
    - HASK
    - ICK
    - ICON
    - JAVA
    - JS
    - 'LISP clisp'
    - 'LISP sbcl'
    - LUA
    - NEM
    - NICE
    - NODEJS
    - 'PAS fpc'
    - 'PAS gpc'
    - PERL
    - PERL6
    - PHP
    - PIKE
    - PRLG
    - PYPY
    - PYTH
    - 'PYTH 3.4'
    - RUBY
    - SCALA
    - 'SCM chicken'
    - 'SCM guile'
    - 'SCM qobi'
    - ST
    - TCL
    - TEXT
    - WSPC
max_timelimit: '1.5'
source_sizelimit: '50000'
problem_author: mgch
problem_tester: xcwgf666
date_added: 12-09-2016
tags:
    - ad
    - easy
    - geometry
    - ltime40
    - math
    - mgch
time:
    view_start_date: 1474736400
    submit_start_date: 1474736400
    visible_start_date: 1474736400
    end_date: 1735669800
    current: 1493558164
layout: problem
---
All submissions for this problem are available.###  Read problems statements in [Mandarin Chinese](http://www.codechef.com/download/translated/LTIME40/mandarin/LTM40CD.pdf), [Russian](http://www.codechef.com/download/translated/LTIME40/russian/LTM40CD.pdf) and [Vietnamese](http://www.codechef.com/download/translated/LTIME40/vietnamese/LTM40CD.pdf) as well.

Chef likes problems on geometry a lot. Please help him to solve one such problem.

Find all possible triangles with integer sides which has the radius of [inscribed circle (also known as incircle)](http://www.mathwords.com/i/inscribed_circle.htm) equal to **R**.

Two triangles are said to be different if they have at least one different side lengths. Formally, let there be two triangles **T1**, **T2**. Let **a, b, c** denote the sides of triangle **T1**, such that **a ≤ b ≤ c**. Similarly, Let **d, e, f** denote the sides of triangle **T2**, such that **d ≤ e ≤ f**. Then **T1** will said to be different from **T2** if either **a ≠ d**, or **b ≠ e** or **c ≠ f**.

### Input

There is a single test case per test file.

The only line of input contains an integer **R**.

### Output

Output in first line single number - number of triangles satisfying statement.

Order the sides of triangles in non-decreasing order. Output all triangles in non-decreasing order, i.e. order first by smallest sides, otherwise by second smallest sides, if first and second sides equal, then by third.

### Constraints

- 1 ≤ **R** ≤ 100

### Subtasks

- **Subtask #1: (20 points)**  1 ≤ **R** ≤ 3
- **Subtask #2: (30 points)**  1 ≤ **R** ≤ 20
- **Subtask #3: (50 points)**  Original constraints

### Example

<pre><b>Input:</b>
<tt>2</tt>

<b>Output:</b>
<tt>5
5 12 13
6 8 10
6 25 29
7 15 20
9 10 17</tt>
</pre>