Chef and Triangles

All submissions for this problem are available.
Read problems statements in Mandarin Chinese, Russian and Vietnamese 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) 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 T_{1}, T_{2}. Let a, b, c denote the sides of triangle T_{1}, such that a ≤ b ≤ c. Similarly, Let d, e, f denote the sides of triangle T_{2}, such that d ≤ e ≤ f. Then T_{1} will said to be different from T_{2} 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 nondecreasing order. Output all triangles in nondecreasing 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
Input: 2 Output: 5 5 12 13 6 8 10 6 25 29 7 15 20 9 10 17
Author:  mgch 
Tester:  xcwgf666 
Tags  adhoc, easy, geometry, ltime40, math, mgch 
Date Added:  12092016 
Time Limit:  1.5 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, PYP3, CLOJ, FS 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions
HELP
If you are still having problems, see a sample solution here. 