#J - (削除) 32 (削除ここまで)(削除) 29 (削除ここまで)(削除) 28 (削除ここまで) 25
J - (削除) 32 (削除ここまで)(削除) 29 (削除ここまで)(削除) 28 (削除ここまで) 25
(削除) Not (削除ここまで) shorter than other J solution, (削除) but (削除ここまで) and uses a different idea
(]{.[:i:-:@-.@]-%)/ ::_1:
The answer for the number of coins the highest rank gnome is getting is simply N/M+(M-1)/2 (if it's an integer), we construct the negative of this -:@-.@]-%. Then i: makes an array like that 2 1 0 _1 _2 for argument _2 and we take M elements from it.
#J - (削除) 32 (削除ここまで)(削除) 29 (削除ここまで)(削除) 28 (削除ここまで) 25
(削除) Not (削除ここまで) shorter than other J solution, (削除) but (削除ここまで) and uses a different idea
(]{.[:i:-:@-.@]-%)/ ::_1:
The answer for the number of coins the highest rank gnome is getting is simply N/M+(M-1)/2 (if it's an integer), we construct the negative of this -:@-.@]-%. Then i: makes an array like that 2 1 0 _1 _2 for argument _2 and we take M elements from it.
J - (削除) 32 (削除ここまで)(削除) 29 (削除ここまで)(削除) 28 (削除ここまで) 25
(削除) Not (削除ここまで) shorter than other J solution, (削除) but (削除ここまで) and uses a different idea
(]{.[:i:-:@-.@]-%)/ ::_1:
The answer for the number of coins the highest rank gnome is getting is simply N/M+(M-1)/2 (if it's an integer), we construct the negative of this -:@-.@]-%. Then i: makes an array like that 2 1 0 _1 _2 for argument _2 and we take M elements from it.
#J - (削除) 32 (削除ここまで) (削除) 29 (削除ここまで) 28(削除) 28 (削除ここまで) 25
(削除) Not (削除ここまで) shorter than other J solution, (削除) but (削除ここまで) and uses a different idea
(]{.[:i:-:@(1-]).@]-[%]%)/ ::_1:
The answer for the number of coins the highest rank gnome is getting is simply N/M+(M-1)/2 (if it's an integer), we construct the negative of this (-:@(1-]).@]-[%])%. Then i: makes an array like that 2 1 0 _1 _2 for argument _2 and we take M elements from it.
#J - (削除) 32 (削除ここまで) (削除) 29 (削除ここまで) 28
(削除) Not (削除ここまで) shorter than other J solution, (削除) but (削除ここまで) and uses a different idea
(]{.[:i:-:@(1-])-[%])/ ::_1:
The answer for the number of coins the highest rank gnome is getting is simply N/M+(M-1)/2 (if it's an integer), we construct the negative of this (-:@(1-])-[%]). Then i: makes an array like that 2 1 0 _1 _2 for argument _2 and we take M elements from it.
#J - (削除) 32 (削除ここまで) (削除) 29 (削除ここまで) (削除) 28 (削除ここまで) 25
(削除) Not (削除ここまで) shorter than other J solution, (削除) but (削除ここまで) and uses a different idea
(]{.[:i:-:@-.@]-%)/ ::_1:
The answer for the number of coins the highest rank gnome is getting is simply N/M+(M-1)/2 (if it's an integer), we construct the negative of this -:@-.@]-%. Then i: makes an array like that 2 1 0 _1 _2 for argument _2 and we take M elements from it.
#J - (削除) 32 (削除ここまで) (削除) 29 (削除ここまで) 28
(削除) Not (削除ここまで) shorter than other J solution, (削除) but (削除ここまで) and uses a different idea
(]{.[:i:-:@(1-])-[%])/ ::_1:
Here is Wolfram Language ungolfing
If[IntegerQ@#,Range[#,#-m+1,-1],-1]&[n/m+(m-1)/2]
The answer for the number of coins the highest rank gnome is getting is simply N/M+(M-1)/2 (if it's an integer), we construct the negative of this (-:@(1-])-[%]). Then i: makes an array like that 2 1 0 _1 _2 for argument _2 and we take M elements from it.
#J - (削除) 32 (削除ここまで) (削除) 29 (削除ここまで) 28
(削除) Not (削除ここまで) shorter than other J solution, (削除) but (削除ここまで) and uses a different idea
(]{.[:i:-:@(1-])-[%])/ ::_1:
Here is Wolfram Language ungolfing
If[IntegerQ@#,Range[#,#-m+1,-1],-1]&[n/m+(m-1)/2]
The answer for the number of coins the highest rank gnome is getting is simply N/M+(M-1)/2 (if it's an integer), we construct the negative of this (-:@(1-])-[%]). Then i: makes an array like that 2 1 0 _1 _2 for argument _2 and we take M elements from it.
#J - (削除) 32 (削除ここまで) (削除) 29 (削除ここまで) 28
(削除) Not (削除ここまで) shorter than other J solution, (削除) but (削除ここまで) and uses a different idea
(]{.[:i:-:@(1-])-[%])/ ::_1:
The answer for the number of coins the highest rank gnome is getting is simply N/M+(M-1)/2 (if it's an integer), we construct the negative of this (-:@(1-])-[%]). Then i: makes an array like that 2 1 0 _1 _2 for argument _2 and we take M elements from it.