Triangle

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

Given integer n print such a triangle:

.
.
.
7
4 8 n-1
2 5 9 n
1 3 6 10 ...

Options

exec is denied

now post-mortem time, all source codes will be revealed

Sample input:_

21

Sample output:

16
11 17
7 12 18
4 8 13 19
2 5 9 14 20
1 3 6 10 15 21

Sample input:_

99

Sample output:

92
79 93
67 80 94
56 68 81 95
46 57 69 82 96
37 47 58 70 83 97
29 38 48 59 71 84 98
22 30 39 49 60 72 85 99
16 23 31 40 50 61 73 86
11 17 24 32 41 51 62 74 87
7 12 18 25 33 42 52 63 75 88
4 8 13 19 26 34 43 53 64 76 89
2 5 9 14 20 27 35 44 54 65 77 90
1 3 6 10 15 21 28 36 45 55 66 78 91

Sample input:_

199

Sample output:

191
172 192
154 173 193
137 155 174 194
121 138 156 175 195
106 122 139 157 176 196
92 107 123 140 158 177 197
79 93 108 124 141 159 178 198
67 80 94 109 125 142 160 179 199
56 68 81 95 110 126 143 161 180
46 57 69 82 96 111 127 144 162 181
37 47 58 70 83 97 112 128 145 163 182
29 38 48 59 71 84 98 113 129 146 164 183
22 30 39 49 60 72 85 99 114 130 147 165 184
16 23 31 40 50 61 73 86 100 115 131 148 166 185
11 17 24 32 41 51 62 74 87 101 116 132 149 167 186
7 12 18 25 33 42 52 63 75 88 102 117 133 150 168 187
4 8 13 19 26 34 43 53 64 76 89 103 118 134 151 169 188
2 5 9 14 20 27 35 44 54 65 77 90 104 119 135 152 170 189
1 3 6 10 15 21 28 36 45 55 66 78 91 105 120 136 153 171 190

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1leonid670.00262010/09/02 03:39:580B / 21B / 44B
2hide24730.17052010/09/02 14:22:010B / 29B / 41B
3yvl790.01422010/08/28 23:16:010B / 36B / 39B
4leonid660.00892010/09/05 04:54:040B / 25B / 40B

Perl _

RankUserSizeTimeDateStatistics
1tybalt89680.00332010/09/04 05:09:000B / ?B / ?B
2sambowry680.00322010/09/04 09:17:220B / 29B / 36B
3lambda720.00342010/08/29 06:30:250B / ?B / ?B
4Mithran760.00372010/08/29 22:06:360B / 28B / 47B
5tails600.00412011/04/01 05:37:230B / 26B / 30B
6teebee(sambowry)610.00512011/02/27 22:20:130B / 27B / 30B

Python _

RankUserSizeTimeDateStatistics
1pv2b960.07442010/09/01 05:36:376B / 47B / 29B
2recursive1010.05602010/09/02 03:35:130B / 47B / 45B
3hallvabo1020.07052010/09/04 12:16:410B / 50B / 33B
4primo1100.07372010/08/30 11:37:070B / 58B / 38B
5nooodl1470.07002010/08/29 21:30:518B / ?B / ?B
6recursive (pv2b)900.07752010/10/22 01:06:240B / 47B / 29B

PHP _

RankUserSizeTimeDateStatistics
1o-cn780.07872010/09/04 01:02:152B / 29B / 47B
2xulapp860.08352010/09/03 22:19:200B / 34B / 49B
3tyoro1440.08362010/08/31 19:01:090B / ?B / ?B
4futaro1470.09852010/08/31 17:48:410B / ?B / ?B

Common LISP _

RankUserSizeTimeDateStatistics
1kozima1040.21432010/09/01 08:47:040B / 45B / 47B

Io _

RankUserSizeTimeDateStatistics
1pooq(*yuko*)1350.49312011/10/02 22:53:140B / 82B / 46B

JavaScript _

RankUserSizeTimeDateStatistics
1nn760.02452010/08/29 22:54:510B / 39B / 36B
2xulapp780.00572010/08/29 11:39:340B / 37B / 40B
3Tomac1090.00592011/10/02 17:35:430B / ?B / ?B

BASIC _

RankUserSizeTimeDateStatistics
1*yuko*810.00392010/08/29 04:43:090B / 46B / 30B

J _

RankUserSizeTimeDateStatistics
1pooq730.09532010/08/29 14:55:400B / 14B / 58B
2I., S.490.14482011/11/13 06:30:130B / 13B / 35B

C _

RankUserSizeTimeDateStatistics
1inaniwa920.00182010/08/30 00:11:320B / 45B / 47B
2not960.00172010/08/29 19:11:240B / 47B / 49B
3msk970.00182010/09/04 01:06:430B / 49B / 48B
4smly990.00182010/08/30 17:51:330B / 45B / 53B
5nn990.00202010/09/01 01:30:110B / 51B / 48B
6yuyarin1010.00172010/08/30 10:55:310B / 49B / 51B
7ranha1030.00192010/08/30 06:31:060B / 45B / 56B
8gattschardo1260.00172010/08/30 17:36:460B / 61B / 65B
9Debanjan1420.00182010/08/29 06:27:530B / ?B / ?B

OCaml _

RankUserSizeTimeDateStatistics
1xsd1120.14362010/08/29 14:45:220B / 58B / 49B
2m.ukai1420.12262010/08/29 11:49:210B / 76B / 57B

Haskell _

RankUserSizeTimeDateStatistics
1notogawa1020.01662010/08/30 23:14:290B / ?B / ?B
2rst761020.06052010/09/03 12:45:360B / 59B / 40B
3Lost_dog1070.05372010/08/30 12:00:450B / 63B / 40B
4pi80271350.00332010/08/29 06:58:320B / 100B / 32B

Pascal _

RankUserSizeTimeDateStatistics
1*yuko*1500.00222010/08/31 17:17:280B / 90B / 49B
2uru1860.00192010/08/29 13:42:310B / 119B / 56B

Fortran _

RankUserSizeTimeDateStatistics
1*yuko*960.00222010/08/31 15:04:590B / 49B / 46B
2*yuko*930.04162011/11/24 01:31:430B / 46B / 45B

AWK _

RankUserSizeTimeDateStatistics
1nn740.03222012/11/19 23:12:340B / 35B / 37B

R _

RankUserSizeTimeDateStatistics
1pooq(*yuko*)1140.88702011/10/04 21:15:580B / 58B / 54B

GolfScript _

RankUserSizeTimeDateStatistics
1narb440.56322010/08/30 20:55:220B / ?B / ?B
2nooodl451.27182010/08/30 06:29:460B / ?B / ?B

FlogScript _

RankUserSizeTimeDateStatistics
1milieu410.51612010/09/02 22:05:590B / ?B / ?B

Vim _

RankUserSizeTimeDateStatistics
1doug680.29592010/09/02 15:29:035B / 30B / 28B
2pla690.47942010/08/29 06:56:116B / 44B / 16B
3clock620.31342012/01/01 13:09:455B / 40B / 15B

Groovy _

RankUserSizeTimeDateStatistics
1nn876.30842010/08/29 23:08:390B / 44B / 41B
2teebee(nn)863.32032011/10/22 20:35:420B / 44B / 40B

Language Ranking_

RankLangUserSizeScore
1FlogScriptmilieu4110000
2GolfScriptnarb449318
3JI., S.498367
4Perltails606833
5Vimclock626612
6Rubyleonid666212
7AWKnn745540
8JavaScriptnn765394
9PHPo-cn785256
10BASIC*yuko*815061
11Groovyteebee(nn)864767
12Pythonrecursive (pv2b)904555
13Cinaniwa924456
14Fortran*yuko*934408
15Haskellnotogawa1024019
16Common LISPkozima1043942
17OCamlxsd1123660
18Rpooq(*yuko*)1143596
19Iopooq(*yuko*)1353037
20Pascal*yuko*1502733

return top