text:
Wolves and Chickens
There's a river and there are wolves and chickens on one side of the river. They have a raft and they all need to get to the other side. However, the raft cannot travel on its own. The raft will sink if more than two animals are on it. None of the animals want to get wet because the river's cold and dirty. None of the animals can jump or fly over the river. Also, if there are chickens on one side, there cannot be more wolves on that side than there are chickens on that side -- the wolves will then decide to eat the chickens. This means that you cannot take two wolves on the raft to a side with one chicken.
Your task is to make a program/function that takes a number of wolves and a number of chickens (greater than or equal to the number of wolves) as input and finds the smallest number of times the raft has to move across the river. If the task is not possible, the program/function should output/return an empty string. It will then print/return one method as to how this is done in the following way:
W if a wolf crosses the river on its own
C if a chicken crosses the river on its own
CW if a chicken and a wolf cross the river -- WC is also fine
CC if two chickens cross the river
WW if two wolves cross the river

As you can deduce, the raft will automatically move in alternating directions (left and right, starting from left to right as the first one or two animals cross the river). This doesn't need to be outputted/returned. 'W', 'C', 'CW', 'CC' or 'WW' in the output may be separated by at least one of the following:
spaces (' ')
commas (',')
newlines

Alternatively, you may store the directions as items in a list (an empty list means no solution).
Test cases (output separated by commas -- input takes the form wolves,chickens):
1,1 -> CW

2,2 -> CW,C,CC,C,CW

1,2 -> CW,W,CW

0,10 -> CC,C,CC,C,CC,C,CC,C,CC,C,CC,C,CC,C,CC,C,CC

3,2 -> no solution

Try to make your code as short in bytes as possible.

The solution for (3,2)?

@carusocomputing It doesn't work, because there are more wolves than chickens. So there's no solution.

Ahh... Maybe label the inputs as W=3, C=2 or something; was a tad confusing to process, other than that this looks cool.

@carusocomputing I would, but I think that it would be more confusing because the input is 3,2 and not W=3,C=2.

For the 2,2 test case, is this solution acceptable ( CW,C,CW,W,CW) ? I think this is the only way to support solutions to equal counts higher than 2.

Hoping for a solution in chicken

Is the permutations tag really suitable here?

@Arnauld Well, the challenge might use permutations...

@Phaeze I haven't tried programming this -- it was a problem in the maths club at my school. I think you're right, but just in case, I won't add it in.

@RobertFraser Nice idea! I rather like the idea of that language -- more interesting to golf in than brainf*** because it's slightly less low-level.

Is a leading space allowed? e.g. " CW C CW"?

@MistahFiggins No.

Those are some powerful chickens if they can take on the wolves one on one :)

"takes a number of wolves and a number of chickens (greater than or equal to the number of wolves)" -- Then why does the last test-case exist? Do we have to deal with the case of wolves>chickens, or not?

Perl, 179 165 164 163 157 156 bytes
Includes +4 for -p
Give wolves followed by chickens on STDIN
river.pl <<< "2 3"

Outputs the boat contents per line. For this example it gives:
WC
C
CC
C
CC
W
WW

river.pl:
#!/usr/bin/perl -p
/ /;@F=w x$`.c x$'."\xaf\n";$a{$`x/\n/}++||grep(y/c//<y/w//&/c/,$_,~$_)or$\||=$' x/^\w*\n|(\w?)(.*)(c|w)(.+)\n(?{push@F,$1.$3.~"$`$2$4\xf5".uc"$'$1$3\n"})^/ for@F}{

Works as shown, but replace \xhh and \n by their literal versions to get the claimed score.
This will probably be beaten by a program that solves the general case (C>W>0)
* output `WC W WC C` until there is only one wolf left on the left bank (--w, --c)
* output `CC C` until there is only one chicken left on the left bank (--c)
* output `WC`

Add to that the trivial solutions for only wolves and only chickens and a hardcoded special case for 2 2 and 3 3 (4 4 and higher have no solution). But that would be a boring program.
Explanation
The current state of the field is stored as a single string consisting of:

w for a wolf    on the bank with the boat
c for a chicken on the bank with the boat
\x88 (bit reversed w) for a wolf    on the other bank
\x9c (bit reversed c) for a chicken on the other bank
A character indicating the side the boat is on P for the right bank, \xaf (bit reversed P) for the left bank (starting side)
a newline \n
all the moves that have been done upto now terminated with newlines, e.g. something like WC\nW\nWC\nC\n (notice the Ws and C are in uppercase here)

The array @F will contain all reachable states. It is initialised by the starting string wolves times "w",  chickens times "c", \xaf \n
The program then loops over @F which will get extended during the looping so new states get processed too. For every element it then does:

Look at the string part left of the first \n which represents the current position of the animals and the boat. If that has been seen before skip $a{$`x/\n/}++
Check if there are chickens together with more wolves on any side. Skip if so grep(y/c//<y/w//&/c/,$_,~$_)
Check if the boat is the far side together with all animals. If so we have a solution. Store that in $\ and keep that since the first solution found is the shortest $\||=$' x/^\w*\n/
Otherwise try all ways of selecting 1 or 2 animals on the side with the boat. These are the c and w characters. (The animals at the other side won't match \w)  /(\w?)(.*)(c|w)(.+)\n(?{code})^/. Then bit reverse the whole string before the \n except the animals that were selected for the boat push@F,$1.$3.~"$`$2$4\xf5". Add the selected animals to the moves by uppercasing them: uc"$'$1$3\n"

The animal selection process effectively shuffles the string part representing them in many ways. So e.g. wcwc and wwcc can both get to represent 2 wolves and 2 chickens. The state check $a{$`x/\n/}++ will unnessarily distinguish these two so many more states than necessary will be generated and checked. Therefore the program will run out of memory and time as soon as the number of different animals gets larger. This is mitigated only a bit by the fact that the current version will stop adding new states once a solution is found

unless i misunderstand what you're saying 4 4 and higher equal counts do have solutions, ie (4,4) = WC,C,WC,W,WC,W,WW,W,WC,W,WW,W,WC

@Phaeze: After WC,C,WC there are 2 wolves and 1 chicken on the right bank. Game over

Yeah my bad I misunderstood part of the problem.

JavaScript (ES6), 251 264 ... 244 240 bytes
Takes the number of wolves and chickens (w, c) and returns one of the optimal solutions, or undefined if there's no solution.
(w,c,v={},B=1/0,S)=>(r=(s,w,c,W=0,C=0,d=1,N=0,k=w+'|'+c+d)=>v[k]|c*w>c*c|C*W>C*C|w<0|c<0|W<0|C<0?0:w|c?[v[k]=1,2,4,8,5].map(n=>r(s+'C'.repeat(b=n>>2)+'W'.repeat(a=n&3)+' ',w-d*a,c-d*b,W+d*a,C+d*b,-d,N+1))&(v[k]=0):N (                               //
r = (...) => ...                     // process recursive calls (see below)
)('', w, c) || S                     // return the best solution

Main recursive function:
r = (                                // given:
  s,                                 // - s : current solution (as text)
  w, c,                              // - w/c : # of chickens/wolves on the left side
  W = 0, C = 0,                      // - W/C : # of chickens/wolves on the right side
  d = 1,                             // - d : direction (1:left to right, -1:right to left)
  N = 0,                             // - N : length of current solution
  k = w + '|' + c + d                // - k : key identifying the current node
) =>                                 //
v[k] |                               // abort if this node was already visited
c * w > c * c | C * W > C * C |      // or there are more wolves than chickens somewhere
w < 0 | c < 0 | W < 0 | C < 0 ?      // or we have created antimatter animals
  0                                  //
:                                    // else:
  w | c ?                            //   if there are still animals on the left side:
    [v[k] = 1, 2, 4, 8, 5].map(n =>  //     set node as visited and do a recursive call
      r(                             //     for each combination: W, WW, C, CC and CW
        s + 'C'.repeat(b = n >> 2) + //     append used combination to current solution
        'W'.repeat(a = n & 3) + ' ', //     wolves = bits 0-1 of n / chickens = bits 2-3
        w - d * a,                   //     update wolves on the left side
        c - d * b,                   //     update chickens on the left side
        W + d * a,                   //     update wolves on the right side
        C + d * b,                   //     update chickens on the right side
        -d,                          //     use opposite direction for the next turn
        N + 1                        //     increment length of current solution
      )                              //
    ) &                              //     once we're done,
    (v[k] = 0)                       //     set this node back to 'not visited'
  :                                  //   else:
    N (r=(s,w,c,W=0,C=0,d=1,N=0,k=w+'|'+c+d)=>v[k]|c*w>c*c|C*W>C*C|w<0|c<0|W<0|C<0?0:w|c?[v[k]=1,2,4,8,5].map(n=>r(s+'C'.repeat(b=n>>2)+'W'.repeat(a=n&3)+' ',w-d*a,c-d*b,W+d*a,C+d*b,-d,N+1))&(v[k]=0):N<B&&(B=N,S=s))('',w,c)||S

console.log(f(1, 1));
console.log(f(2, 2));
console.log(f(1, 2));
console.log(f(0, 10));
console.log(f(3, 2));

The challenge says and finds the smallest number of times the raft has to move across the river.. so I don't think this is a valid solution

@Arnauld The OP to answer what? I think it's clear that you must only output the shortest solution, not others.

@Arnauld Ton Hospel is right.

@Arnauld If you make it so that it doesn't print out other solutions -- just the shortest solution, then it should be fine.

@J843136028 Hopefully I got it right this time. ^^

@Arnauld Yep! :-D

CJam, 133
q~[0_]]_0+a:A;a{{28e3Zb2/{[YT2*(f*_Wf*]X..+:Bs'-&B2<{~_@<*},+{B2<T!+a:CA&{AC+:A;BY"WC".*a+}|}|}fY}fX]T!:T;__!\{0=:+!},e|:R!}g;R0=2>S*

Try it online
Explanation:
Basically the program does a BFS and remembers every state it reached in order to avoid infinite cycles. The working states are represented like [[Wl Cl] [Wr Cr] M1 M2 … Mn] where W = wolves, C = chickens, l = left side, r = right side, M = moves made so far (initially none), and the moves are like "C", "WC" or "WW" etc (practically more like ["" "C"], ["W" "C"], ["WW" ""], but it's the same when printing). The remembered states are represented like [[Wl Cl] [Wr Cr] S] where S is the side with the boat (0=left, 1=right).
q~                 read and evaluate the input ([Wl Cl] array)
[0_]               push [0 0] as the initial [Wr Cr] array
]_                 wrap both in an array (initial working state) and duplicate it
0+a                append 0 (representing left side) and wrap in an array
:A;                store in A and pop; this is the array of remembered states
a                  wrap the working state in an array
{…}g               do … while
  {…}fX            for each working state X
    28e3Zb2/       convert 28000 to base 3 and group the digits into pairs
                    this generates [[1 1] [0 2] [1 0] [2 0] [0 1]]
                    which are all possible moves represented as [Wb Cb] (b=boat)
    {…}fY          for each "numeric move" pair Y
      […]          make an array of…
        YT2*(f*    Y negated if T=0 (T is the current boat side, initially 0)
        _Wf*       and the (arithmetic) negation of the previous pair
      X..+         add the 2 pairs to X, element by element
                    this performs the move by adding & subtracting the numbers
                    from the appropriate sides, determined by T
      :Bs          store the updated state in B, then convert to string
      '-&          intersect with "-" to see if there was any negative number
      B2<          also get just the animal counts from B (first 2 pairs)
      {…},         filter the 2 sides by checking…
        ~_@<*      if W>C>0 (it calculates (C<W)*C)
      +            concatenate the results from the negative test and eating test
      {…}|         if it comes up empty (valid state)…
        B2<        get the animal counts from B (first 2 pairs)
        T!+        append !T (opposite side)
        a:C        wrap in an array and store in C
        A&         intersect with A to see if we already reached that state
        {…}|       if not, then…
          AC+:A;   append C to A
          BY       push B and Y (updated state and numeric move)
          "WC".*   repeat "W" and "C" the corresponding numbers of times from Y
                    to generate the alphabetic move
          a+       wrap in array and append to B (adding the current move)
  ]                collect all the derived states in an array
  T!:T;            reverse the side with the boat
  __!              make 2 copies of the state array, and check if it's empty
  \{…},            filter another copy of it, checking for each state…
    0=:+!          if the left side adds up to 0
  e|:R             logical "or" the two and store the result in R
  !                (logically) negate R, using it as a do-while condition
                    the loop ends when there are no more working states
                    or there are states with the left side empty
;                  after the loop, pop the last state array
R0=2>S*            if the problem is solved, R has solution states,
                    and this extracts the moves from the first state
                    and joins them with space
                   if there's no solution, R=1
                    and this repeats a space 0 times, resulting in empty string

Perl 6, 268 bytes
->*@a {(
[X](0 X..@a)[1..*-2]
.grep({![>](|$_,0)&![>](|(@a Z-$_),0)})
.combinations(2)
.combinations
.map(|*.permutations)
.map({.map(|*)»[*]})
.map({((|$_,(0,0)ZZ-@a,|$_)ZX*|(-1,1)xx*)»[*]})
.grep({.all.&{.all>=0&&3>.sum>0}})
.map({.map:{[~](<W C>Zx$_)}})
if [<=] @a
)[0]//()}

Generates increasingly longer chains of (wolf count, chicken count) states for the left bank, and returns the first one that matches all the rules.
Turns out this approach is neither efficient nor very concise, but at least it was fun to write.
I don't think I've never stacked the Z (zip) and X (cross) meta-operators before, like the ZZ- and ZX* here - kinda surprised that actually worked.
(The newlines are just added for display purposes, and aren't part of the byte count.)

JavaScript (ES6), 227 237
Basically it does a BFS and remembers every state it reached in order to avoid infinite cycles. Unlike @aditsu's, I don't think there's any room for golfing
v=>g=>eval("o=[],s=[[v,g,0,k=[]]];for(i=0;y=s[i++];k[y]=k[y]||['WW','C','CC','W','CW'].map((u,j)=>(r=w-(j?j/3|0:2),q=c-j%3,d=g-q,e=v-r,r<0|q<0|!!q&r>q|!!d&e>d)||s.push([e,d,!z,[...p,u]])))o=([w,c,z,p]=y,y[3]=!z|c-g|w-v)?o:i=p")

Less golfed
(v,g) => {
  o = []; // output
  k = []; // hashtable to check states already seen
  s=[[v, g, 0, []]]; // states list: each element is wolves,chickens,side,path
  for(i = 0;
      y = s[i++]; // exit loop when there are no more states to expand
     )
  {
    [w, c, z, p] = x; // wolves on this side, chickens on this side, side, path
    if (z && c==g && w==v) // if all chicken and wolves on the other side
      o = p, // the current path is the output
      i = p  // this will force the loop to terminate
    y[3] = 0; // forget the path, now I can use y as the key to check state and avoid cycles
    if (! k[y]) // it's a new state
    {
       k[y] = 1; // remember it
       ['WW','C','CC','W','CW'].map( (u,j)=> (
          a = j ? j/3|0 : 2, // wolves to move
          b = j % 3, // chicken to move
          r = w - a, // new number of wolves on this side
          q = c - b, // new number of chickens on this side
          e = v - r, // new number of wolves on other side
          d = g - q, // new number of chickens on other side
          // check condition about the number of animals together
          // if ok, push a new state
          r<0 |q<0 | !!q&r>q | !!d&e>d ||
            s.push([e, d, !z, [...p,u])
       )
    }
  }
  return o
}

Test

F=
v=>g=>eval("o=[],s=[[v,g,0,k=[]]];for(i=0;y=s[i++];k[y]=k[y]||['WW','C','CC','W','CW'].map((u,j)=>(r=w-(j?j/3|0:2),q=c-j%3,d=g-q,e=v-r,r<0|q<0|!!q&r>q|!!d&e>d)||s.push([e,d,!z,[...p,u]])))o=([w,c,z,p]=y,y[3]=!z|c-g|w-v)?o:i=p")

function update() {
  var c=+C.value, w=+W.value
  O.textContent=F(w)(c)
}

update()
input { width: 4em }
Chickens <input id=C value=2 type=number min=0 oninput='update()'>
Wolves <input id=W value=2 type=number min=0 oninput='update()'>


text:
A penny saved is a penny
...counted!
You will pass your program a variable which represents a quantity of money in dollars and/or cents and an array of coin values.  Your challenge is to output the number of possible combinations of the given array of coin values that would add up to the amount passed to the code.  If it is not possible with the coins named, the program should return 0.
Note on American numismatic terminology:

1-cent coin: penny
5-cent coin: nickel
10-cent coin: dime
25-cent coin: quarter (quarter dollar)

Example 1:
Program is passed:
12, [1, 5, 10]

(12 cents)
Output:
4

There are 4 possible ways of combining the coins named to produce 12 cents:

12 pennies
1 nickel and 7 pennies
2 nickels and 2 pennies
1 dime and 2 pennies

Example 2:
Program is passed:
26, [1, 5, 10, 25]

(26 cents)
Output:
13

There are 13 possible ways of combining the coins named to produce 26 cents:

26 pennies
21 pennies and 1 nickel
16 pennies and 2 nickels
11 pennies and 3 nickels
6 pennies and 4 nickels
1 penny and 5 nickels
16 pennies and 1 dime
6 pennies and 2 dimes
11 pennies, 1 dime, and 1 nickel
6 pennies, 1 dime, and 2 nickels
1 penny, 1 dime, and 3 nickels
1 penny, 2 dimes, and 1 nickel
1 quarter and 1 penny

Example 3:
Program is passed:
19, [2, 7, 12]

Output:
2

There are 2 possible ways of combining the coins named to produce 19 cents:

1 12-cent coin and 1 7-cent coin
1 7-cent coin and 6 2-cent coins

Example 4:
Program is passed:
13, [2, 8, 25]

Output:
0

There are no possible ways of combining the coins named to produce 13 cents.

This has been through the Sandbox.  Standard loopholes apply.  This is code golf, so the answer with the fewest bytes wins.

s/counted/earned

Can we input the coin values in reverse order (i.e. [25, 10, 5, 1])?

Can we assume that the list is not empty?

@ETHproductions, I would say yes.

@ChristianSievers, again, I would say yes.

@mbomb007 For four bytes: s/count/earn.

For me and I guess for other people who don't pay with dollars it's not obvious what a nickel and a dime is. It wasn't hard to figure it out, but maybe you could write it a bit more international?

@Kritzefitz. I've added that to the question.

and what would be the result of 1209[1,5,10,33,48] and 6000[1,5,10,33] so i can calibrate my code (not i say i would post another answers )

Pedantic note on terminology: The official name for the US 1-cent coin is cent. Penny only comes up in informal usage, or when talking about the UK 1-cent coin.

@jpaugh: While coin-o-philes might agree, I'd have to disagree. A penny is the standard coin that has a value of one cent. Fifty-four cents is an amount of money. Fifty-four pennies is explicitly fifty-four coins. It's also called a "one-cent coin", or (officially) a "one-cent piece". I can't think of any formal setting where the word "penny" would be unacceptable. These people, who are specifically about collecting coins, have no problem calling it a "penny".

I wonder why you didn't make them print the combinations.   That would have confounded the Froeniuses :)

@MichaelS As you say, popular usage makes the official name fairly moot, and I find that fascinating. I myself refer to this coin almost exclusively as "the penny," while referring to the amount as "one cent."  I imagine the US wanted to distinguish itself from Britain at the time, but changing a long-established convention is not so easy!

Sorry, @jpaugh, I'm not from the US.  In Canada, we definitely follow the nomenclature that MichaelS outlined.  I really don't know what the facts are in the States... Sorry for the obscurity there!

@anonymous2 No sweat. Just an obscure oddity of language. (In the US, we certainly follow the nomenclature MichaelS mentioned. It's just not "official.")

Ah, ok.  I've got you.  I don't know whether it's official or not in Canada... :)

So i  did not post a solution for this, and have the solutions... Is i'am that cancel my solution of this or who? Thanks...

Jelly (fork), 2 bytes
æf

This relies on a branch of Jelly where I was working on implementing Frobenius solve atoms so unfortunately you cannot try it online.
Usage
$ ./jelly eun 'æf' '12' '[1,5,10]'
4
$ ./jelly eun 'æf' '26' '[1,5,10,25]'
13
$ ./jelly eun 'æf' '19' '[2,7,12]'
2
$ ./jelly eun 'æf' '13' '[2,8,25]'
0

Explanation
æf  Input: total T, denominations D
æf  Frobenius count, determines the number of solutions
    of nonnegative X such that X dot-product D = T

...that's not even fair.

...and I bet it's much faster!

Haskell, 37 34 bytes
s#l@(c:d)|s>=c=(s-c)#l+s#d
s#_=0^s

Usage example: 26 # [1,5,10,25] -> 13.
Simple recursive approach: try both the next number in the list (as long as it is less or equal to the amount) and skip it. If subtracting the number leads to an amount of zero, take a 1 else (or if the list runs out of elements) take a 0. Sum those 1s and 0s.
Edit: @Damien: saved 3 bytes by pointing to a shorter base case for the recursion (which also can be found in @xnors answer).

s#l@(c:d)|s>=c=(s-c)#l+s#d;s#_=0^s

and what would be the result of 1209[1,5,10,33,48] and 6000[1,5,10,33] so i can calibrate my code

@RosLuP: 1209 # [1,5,10,33,48]->  1314050.

@nimi ok for 1314050 I have the same result here... Thanks...

@RosLuP: ... 537min later: 6000 # [1,5,10,33] -> 22086484.

Mathematica, 35 22 bytes
Thanks to miles for suggesting FrobeniusSolve and saving 13 bytes.
Length@*FrobeniusSolve

Evaluates to an unnamed function, which takes the list of coins as the first argument and the target value as the second. FrobeniusSolve is a shorthand for solving Diophantine equations of the form
a1x1 + a2x2 + ... + anxn = b
for the xi over the non-negative integers and gives us all the solutions.

@RosLuP You will need access to Mathematica to run this. Also this is an anonymous function so to call it, either encapsulate it in parentheses or store it to a variable. For example, (Length@*FrobeniusSolve)[{1, 7, 9}, 18]

and what would be the result of 1209[1,5,10,33,48] and 6000[1,5,10,33] so i can calibrate my code

@RosLuP 1314050 and 22086484, respectively.

Ok here result the same, thanks...

16 votes for this are justified only if the programmer that wrote Length @ * FrobeniusSolve are you...

Pyth, 8 bytes
/sM{yS*E

Raw brute force, too memory intensive for actual testing. This is O(2mn), where n is the number of coins and m is the target sum. Takes input as target\n[c,o,i,n,s].
/sM{yS*EQQ      (implicit Q's)
      *EQ       multiply coin list by target
     S          sort
    y           powerset (all subsequences)
   {            remove duplicates
 sM             sum all results
/        Q      count correct sums

JavaScript (ES6), 51 48 bytes
f=(n,a,[c,...b]=a)=>n?n>0&&c?f(n-c,a)+f(n,b):0:1

Accepts coins in any order. Tries both using and not using the first coin, recursively calculating the number of combinations either way. n==0 means a matching combination, n<0 means that the coins exceed the quantity while c==undefined means that there are no coins left. Note that the function is very slow and if you have a penny coin then the following function is faster (don't pass the penny coin in the array of coins):
f=(n,a,[c,...b]=a)=>c?(c<=n&&f(n-c,a))+f(n,b):1

...dangit. Real nice idea.

and what would be the result of 1209[1,5,10,33,48] and 6000[1,5,10,33] so i can calibrate my code

@RosLuP The given code eventually returns 1314050 for your first example. My interpreter can't handle the recursion necessary to evaluate the second example.

@RosLuP I modified the function to assume an additional penny coin exists and that returned 22086484 for 6000[5,10,33].

@Neil ok 22086484 for 6000[1,5,10,33]... Instead would be 11239 here for 6000[5,10,33] (the array you wrote)

@RosLuP The modified function adds the penny coin to the list for you before counting the combinations, which is why it returns the value it does, but it's much quicker than using the generic function which works for sets of coins that don't include pennies.

Haskell, 37 bytes
s%(h:t)=sum$map(%t)[s,s-h..0]
s%_=0^s

Using some multiple of the first coin h decreases the required sum s to a non-negative value in the decreasing progression [s,s-h..0], which then must be made with the remaining coins. Once there's no coins left, check that the sum is zero arithmetically as 0^s.

It's amazing how you hit exactly the same byte count as @nimi using a different approach.

Perl, 45 bytes
Byte count includes 44 bytes of code and -p flag.
s%\S+%(1{$&})*%g,(1x<>)=~/^$_$(?{$\++})^/x}{

Takes the coin values on the first line, and the targeted amount on the second line :
$ perl -pE 's%\S+%(1{$&})*%g,(1x<>)=~/^$_$(?{$\++})^/x}{' <<< "1 5 10 25
26"
13

Short explanations:
-p                        # Set $_ to the value of the input,
                          # and adds a print at the end of the code.
s%\S+%(1{$&})*%g,         # Converts each number n to (1{$&})* (to prepare the regex)
                          # This pattern does half the job.
(1x<>)                    # Converts the target to unary representation.
  =~                      # Match against.. (regex)
    /^ $_ $               # $_ contains the pattern we prepared with the first line.
     (?{$\++})            # Count the number of successful matches
     ^                    # Forces a fail in the regex since the begining can't be matched here.
    /x                    # Ignore white-spaces in the regex
                          # (needed since the available coins are space-separated)
 }{                       # End the code block to avoid the input being printed (because of -p flag)
                          # The print will still be executed, but $_ will be empty,
                          # and only $\ will be printed (this variable is added after every print)

JavaScript (ES6), 59 bytes
f=(n,c)=>n?c.reduce((x,y,i)=>y>n?x:x+f(n-y,c.slice(i)),0):1

Coins are input from highest to lowest, e.g. f(26,[100,25,10,5,1]). If you have a penny, remove it and use this much faster version instead:
f=(n,c)=>n?c.reduce((x,y,i)=>y>n?x:x+f(n-y,c.slice(i)),1):1

This uses a recursive formula much like @nimi's. I originally wrote this a few days ago when the challenge was still in the sandbox; it looked like this:
f=(n,c=[100,25,10,5])=>n?c.reduce((x,y,i)=>y>n?x:x+f(n-y,c.slice(i)),1):1

The only differences being the default value of c (it had a set value in the original challenge), and changing the 0 in the .reduce function to 1 (this was two bytes shorter and a bazillion times faster than c=[100,25,10,5,1]).

Here's a modified version which outputs all combinations, rather than the number of combinations:
f=(n,c)=>n?c.reduce((x,y,i)=>y>n?x:[...x,...f(n-y,c.slice(i)).map(c=>[...c,y])],[]):[[]]

and what would be the result of 1209[1,5,10,33,48] and 6000[1,5,10,33] so i can calibrate my code

@RosLuP I get 1314050 (after 5 minutes) and a stack overflow (after an hour), respectively. With the faster version I just added, I get 1314050 and 22086484 within a few seconds.

With my old Pentium 2.8Gh computer 6 seconds for the first result, for the second 5 minutes +or -

Jelly, 10 9 bytes
œċÐ€S€€Fċ

Try it online!
How?
œċÐ€S€€Fċ - Main link: coins, target
  Ð€      - map over right argument, or for each n in [1,2,...,target]
œċ        - combinations with replacement, possible choices of each of n coins
    S€€   - sum for each for each (values of those selections)
       F  - flatten into one list
        ċ - count occurrences of right argument

+1 for using that many Euro-symbols in a money-related question.

PHP, 327 Bytes
function c($f,$z=0){global$p,$d;if($z){foreach($p as$m){for($j=0;$j<=$f/$d[$z];){$n=$m;$n[$d[$z]]=$j++;$p[]=$n;}}}else for($p=[],$j=0;$j<=$f/$d[$z];$j++)$p[]=[$d[$z]=>$j];if($d[++$z])c($f,$z);}$d=$_GET[a];c($e=$_GET[b]);foreach($p as$u){$s=0;foreach($u as$k=>$v)$s+=$v*$k;if($s==$e&count($u)==count($d))$t[]=$u;}echo count($t);

Try it

Axiom, 63 62 bytes
1 byte saved by @JonathanAllan
f(n,l)==coefficient(series(reduce(*,[1/(1-x^i)for i in l])),n)

This approach uses generating functions. Probably that didn't help bring down the code size. I think this is the first time that in my playing with Axiom I went as far as defining my own function.
The first time the function is called it gives a horrendous warning, but still produces the correct result. After that, everything is fine as long as the list isn't empty.

I don't know Axiom - is it possible to remove the space before for?

@JonathanAllan Yes, it is! Good golfing instinct, thanks!

R, 81 76 63 bytes
Thanks to @rturnbull for golfing away 13 bytes!
function(u,v)sum(t(t(expand.grid(lapply(u/v,seq,f=0))))%*%v==u)

Example (note that c(...) is how you pass vectors of values to R):
f(12,c(1,5,10))
[1] 4

Explanation:
u is the desired value, v is the vector of coin values.
expand.grid(lapply(u/v,seq,from=0))

creates a data frame with every possible combination of 0 to k coins (k depends on the denomination), where k is the lowest such that k times the value of that coin is at least u (the value to achieve).
Normally we would use as.matrix to turns that into a matrix, but that is many characters. Instead we take the transpose of the transpose (!) which automatically coerces it, but takes fewer characters.
%*% v then calculates the monetary value of each row. The last step is to count how many of those values are equal to the desired value u.
Note that the computational complexity and memory requirements of this are horrific but hey, it's code golf.

Nice use of expand.grid! And I love the t(t()) trick. Since your function only involves a single line of code, you can remove the curly braces, saving you 2 bytes. Also, you can switch do.call(expand.grid,lapply(u/v,seq,from=0)) for just expand.grid(lapply(u/v,seq,f=0)), saving 11 bytes.

Thanks for those! I never realised expand.grid would take a list as input. It's a bit of a shame that ":" doesn't work well with non-integers otherwise lapply(u/v,":",0) would have saved a couple more.

do.call(x,y) is the same as x(y), so it's not about what kinds of input are accepted. If you really want to use :, I suppose you could use lapply(u%/%v,\:`,0)`, but it's the same byte count.

"do.call(x,y) is the same as x(y)" --- only if y isn't a list, which it is in this case. Agree on your second point, though.

J, 27 bytes
1#.[=](+/ .*~]#:,@i.)1+<.@%

Usage
   f =: 1#.[=](+/ .*~]#:,@i.)1+<.@%
   12 f 1 5 10
4
   26 f 1 5 10 25
13
   19 f 2 7 12
2
   13 f 2 8 25
0

Explanation
1#.[=](+/ .*~]#:,@i.)1+<.@%  Input: target T (LHS), denominations D (RHS)
                          %  Divide T by each in D
                       <.@   Floor each
                             These are the maximum number of each denomination
                     1+      Add 1 to each, call these B
                ,@i.         Forms the range 0 the the product of B
             ]               Get B
              #:             Convert each in the range to mixed radix B
     ]                       Get D
       +/ .*~                Dot product between D and each mixed radix number
                             These are all combinations of denominations up to T
   [                         Get T
    =                        Test if each sum is equal to T
1#.                          Convert as base 1 digits to decimal (takes the sum)
                             This is the number of times each sum was true

J is so awesome, yet also, so insane

tinylisp repl, 66 bytes
(d C(q((Q V)(i Q(i(l Q 0)0(i V(s(C(s Q(h V))V)(s 0(C Q(t V))))0))1

Recursive solution: tries using the first coin and not using the first coin, then adds the results from each. Exponential time complexity and no tail-recursion, but it computes the test cases just fine.
Ungolfed (key to builtins: d = define, q = quote, i = if, l = less-than, s = subtract, h = head, t = tail):
(d combos
 (q
  ((amount coin-values)
   (i amount
    (i (l amount 0)
     0
     (i coin-values
      (s
       (combos
        (s amount (h coin-values))
        coin-values)
       (s
        0
        (combos
         amount
         (t coin-values))))
      0))
    1))))

Example usage:
tl> (d C(q((Q V)(i Q(i(l Q 0)0(i V(s(C(s Q(h V))V)(s 0(C Q(t V))))0))1
C
tl> (C 12 (q (1 5 10)))
4
tl> (C 26 (q (1 5 10 25)))
13
tl> (C 19 (q (2 7 12)))
2
tl> (C 13 (q (2 8 25)))
0
tl> (C 400 (q (1 5 10 25)))
Error: recursion depth exceeded. How could you forget to use tail calls?!

TSQL, 105 bytes
This can only handle up to one dollar with these 4 coin types. The ungolfed version can handle up to around 4 dollars, but very slow - on my box this takes 27 seconds. Result is 10045 combinations b.t.w.
Golfed:
DECLARE @ INT = 100
DECLARE @t table(z int)
INSERT @t values(1),(5),(10),(25)
;WITH c as(SELECT 0l,0s UNION ALL SELECT z,s+z FROM c,@t WHERE l<=z and s<@)SELECT SUM(1)FROM c WHERE s=@

Ungolfed:
-- input variables
DECLARE @ INT = 100
DECLARE @t table(z int)
INSERT @t values(1),(5),(10),(25)

-- query
;WITH c as
(
  SELECT 0l,0s
  UNION ALL
  SELECT z,s+z
  FROM c,@t
  WHERE l<=z and s<@
)
SELECT SUM(1)
FROM c
WHERE s=@
-- to allow more than 100 recursions(amounts higher than 1 dollar in this example)
OPTION(MAXRECURSION 0)

Fiddle

Actually, 15 bytes
Golfing suggestions welcome. Try it online!
╗;R`╜∙♂S╔♂Σi`Mc

Ungolfing
         Implicit input n, then the list of coins a.
╗        Save a to register 0.
;R       Duplicate n and create a range [1..n] from that duplicate.
`...`M   Map the following function over that range. Variable i.
  ╜        Push a from register 0.
  ∙        Push the i-th Cartesian power of a.
  ♂S       Sort each member of car_pow.
  ╔        Uniquify car_pow so we don't count too any duplicate coin arrangements.
  ♂Σ       Take the sum of each coin arrangement.
  i        Flatten the list.
c        Using the result of the map and the remaining n, push map.count(n).
         Implicit return.

PHP, 130 bytes
function r($n,$a){if($c=$a[0])for(;0<$n;$n-=$c)$o+=r($n,array_slice($a,1));return$o?:$n==0;}echo r($argv[1],array_slice($argv,2));

99 byte recursive function (and 31 bytes of calling it) that repeatedly removes the value of the current coin from the target and calls itself with the new value and the other coins. Counts the number of times the target reaches 0 exactly. Run like:
 php -r "function r($n,$a){if($c=$a[0])for(;0<$n;$n-=$c)$o+=r($n,array_slice($a,1));return$o?:$n==0;}echo r($argv[1],array_slice($argv,2));" 12 1 5 10

If called with more than 97 different types of coin it will die a recursion death without returning anything but as that's far more different types of coin then we have to support it's fine.

Racket 275 bytes
(set! l(flatten(for/list((i l))(for/list((j(floor(/ s i))))i))))(define oll'())(for((i(range 1(add1(floor(/ s(apply min l)))))))
(define ol(combinations l i))(for((j ol))(set! j(sort j >))(when(and(= s(apply + j))(not(ormap(λ(x)(equal? x j))oll)))(set! oll(cons j oll)))))oll

Ungolfed:
(define(f s l)
  (set! l              ; have list contain all possible coins that can be used
        (flatten
         (for/list ((i l))
           (for/list ((j
                       (floor
                        (/ s i))))
             i))))
  (define oll '())                    ; final list of all solutions initialized
  (for ((i (range 1
                  (add1
                   (floor             ; for different sizes of coin-set
                    (/ s
                       (apply min l)))))))
    (define ol (combinations l i))          ; get a list of all combinations
    (for ((j ol))                           ; test each combination
      (set! j (sort j >))
      (when (and
             (= s (apply + j))              ; sum is correct
             (not(ormap                     ; solution is not already in list
                  (lambda(x)
                    (equal? x j))
                  oll)))
        (set! oll (cons j oll))             ; add found solution to final list
        )))
  (reverse oll))

Testing:
(f 4 '[1 2])
(println "-------------")
(f 12 '[1 5 10])
(println "-------------")
(f 19 '[2 7 12])
(println "-------------")
(f 8 '(1 2 3))

Output:
'((2 2) (2 1 1) (1 1 1 1))
"-------------"
'((10 1 1) (5 5 1 1) (5 1 1 1 1 1 1 1) (1 1 1 1 1 1 1 1 1 1 1 1))
"-------------"
'((12 7) (7 2 2 2 2 2 2))
"-------------"
'((3 3 2) (2 2 2 2) (3 2 2 1) (3 3 1 1) (2 2 2 1 1) (3 2 1 1 1) (2 2 1 1 1 1) (3 1 1 1 1 1) (2 1 1 1 1 1 1) (1 1 1 1 1 1 1 1))

Following recursive solution has some error:
(define (f s l)                      ; s is sum needed; l is list of coin-types
  (set! l (sort l >))
  (define oll '())                   ; list of all solution lists
  (let loop ((l l)
             (ol '()))               ; a solution list initialized
    (when (not (null? l))
        (set! ol (cons (first l) ol)))
    (define ols (apply + ol))        ; current sum in solution list
    (cond
      [(null? l) (remove-duplicates oll)]
      [(= ols s) (set! oll (cons ol oll))
                 (loop (rest l) '())
                 ]
      [(> ols s) (loop (rest l) (rest ol))
                 (loop (rest l) '())
                 ]
      [(< ols s) (loop l ol)
                 (loop (rest l) ol)
                 ])))

Does not work properly for:
(f 8 '[1 2 3])

Output:
'((1 1 1 2 3) (1 2 2 3) (1 1 1 1 1 1 1 1) (2 3 3) (1 1 1 1 1 1 2) (1 1 1 1 2 2) (1 1 2 2 2) (2 2 2 2))

(1 1 3 3) is possible but does not come in solution list.

I'm not familiar with Racket, but I did write a solution in Clojure for a similar problem to this a few years ago that made use of reduce

'reduce' is not part of base Racket language, although 'fold' is available. I have added a modified solution above since earlier solution has some error.

Looks like a bunch of Lisp enthusiasts got together...and made a racket

Some of Lisp enthusiasts first made a Scheme (https://groups.csail.mit.edu/mac/projects/scheme/) which finally led to full-blown Racket (http://racket-lang.org/ ,  https://stackoverflow.com/questions/3345397/how-is-racket-different-from-scheme) !

Jelly, 15 bytes
s+\Fṁḷ
2*BW;ç/Ṫ

Try it online! or Verify all test cases.
This was more of an exercise in writing an efficient version in Jelly without using builtins. This is based on the typical dynamic programming approach used to calculate the number of ways for making change
Explanation
s+\Fṁḷ  Helper link. Input: solutions S, coin C
s       Slice the solutions into non-overlapping sublists of length C
 +\     Cumulative sum
   F    Flatten
     ḷ  Left, get S
    ṁ   Mold the sums to the shape of S

2*BW;ç/Ṫ  Main link. Input: target T, denominations D
2*        Compute 2^T
  B       Convert to binary, creates a list with 1 followed by T-1 0's
          These are the number of solutions for each value from 0 to T
          starting with no coins used
   W      Wrap it inside another array
    ;     Concatenate with D
     ç/   Reduce using the helper link
       Ṫ  Tail, return the last value which is the solution

Python, 120 bytes
from itertools import*
lambda t,L:[sum(map(lambda x,y:x*y,C,L))-t for C in product(range(t+1),repeat=len(L))].count(0)

Bruteforces through all combinations of coins up to target value (even if the smallest is not 1).

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Maximal number of regions obtained by joining n points around a circle by straight lines
Let's define f(n) as the maximal number of regions obtained by joining n points around a circle by straight lines. For example, two points would split the circle into two pieces, three into four, like this:

Make sure when you are drawing the lines, you don't have an intersection of more than two lines.
Your task
Given a number n, print f(n).
Test cases:
 n | f(n)
---+-----
 1 |   1
 2 |   2
 3 |   4
 4 |   8
 5 |  16
 6 |  31
 7 |  57
 8 |  99
 9 | 163

You can see more here.
Using built-in sequence generators is not allowed.
Remember, this is code-golf, so the code with the smallest number of bytes wins.
If you guys want the formula, here it is:

Mathematica, 23 bytes
Tr@Binomial[#,{0,2,4}]&

Uses the formula in the question.

Jelly, 6 bytes
5Ḷc@’S

Try it online! | Verify test cases
Explanation
Uses the OEIS formula ((n-1)C4 + (n-1)C3 + ... + (n-1)C0).
5Ḷc@’S    Main link.  Args: n

5         Yield 5.
 Ḷ        Lowered range: yield [0,1,2,3,4].
    ’     Yield n-1.
   @      Swap operands of the preceding dyad, 'c'.
  c       Combinations: yield [(n-1)C0, (n-1)C1, (n-1)C2, (n-1)C3, (n-1)C4].
     S    Sum: return (n-1)C0 + (n-1)C1 + (n-1)C2 + (n-1)C3 + (n-1)C4.

Welcome to PPCG and great first answer!

JavaScript (ES6), 29 bytes
n=>(((n-6)*n+23)*n/6-3)*n/4+1

Uses a formula given in OEIS.

Jelly, 6 bytes
c3ḶḤ¤S

Try it online! or verify all test cases.
How it works
c3ḶḤ¤S  Main link. Argument: n

    ¤   Combine the three links to the left into a niladic chain.
 3        Yield 3.
  Ḷ       Unlength; yield [0, 1, 2].
   Ḥ      Unhalve; yield [0, 2, 4].
c       Combinations; compute [nC0, nC2, nC4].
     S  Sum; return nC0 + nc2 + nC4.

MATL, 7 bytes
q5:qXns

Try it online! Or verify all test cases.
Explanation
Uses the formula (from OEIS): a(n) = C(n−1, 4) + C(n−1, 3) + ... + C(n−1, 0)
q      % Implicit input. Subtract 1
5:q    % Array [0 1 2 3 4]
Xn     % Binomial coefficient, vectorized
s      % Sum

Java 7,50 47 bytes
int c(int n){return(n*n*(n-6)+23*n-18)*n/24+1;}

Uses the formula (from OEIS)

><>, 27 26+3 = 29 bytes
3 bytes added for the -v flag
::::6-**$f8+*f3+-+*f9+,1+n

Try it online!
A byte saved thanks to Martin Ender.

R, 25 bytes
sum(choose(scan(),0:2*2))

scan() takes the input n from stdin, which is passed to choose along with 0:2*2. This latter term is 0 to 2 (i.e. [0, 1, 2]) multiplied by 2, which is [0, 2, 4]. Since choose is vectorized, this calculates n choose 0, n choose 2, n choose 4, and returns them in a list. Finally, sum returns the sum of these numbers, surprisingly enough.
I don't think that this can be golfed further but I would be very happy to be proven wrong!

I was 2 seconds from submitting the same solution, nice!

tinylisp, 73 bytes
(load library)
(d D(q((N)(+(/(*(s N 1)N(s N 2)(s N 3))24)(/(*(s N 1)N)2)1

Try it online!
From Giuseppe.
tinylisp, 90 bytes
(d C(q((N K)(i K(i N(a(C(s N 1)(s K 1))(C(s N 1)K))0)1
(d D(q((N)(a(a(C N 0)(C N 2))(C N 4

Try it online!

You're only using library for + which is rather wasteful so just use a twice: Try it online! I think neil's answer is using floordiv which is why it doesn't port quite right.

Could port the R answer as well...

dc, 21
?ddd6-*23+*6/3-*4/1+p

RPN-ised version of @Neil's answer.
Test output:
$ for i in {1..9}; do dc -e "?ddd6-*23+*6/3-*4/1+p" <<< $i; done
1
2
4
8
16
31
57
99
163
$

J, 9 bytes
+4&!+2!<:

Uses the formula C(n-1, 2) + C(n, 4) + n = C(n, 0) + C(n, 2) + C(n, 4).
Usage
   f =: +4&!+2!<:
   (,.f"0) >: i. 10
 1   1
 2   2
 3   4
 4   8
 5  16
 6  31
 7  57
 8  99
 9 163
10 256
   f 20
5036

Explanation
+4&!+2!<:  Input: integer n
       <:  Decrement n
     2     The constant 2
      !    Binomial coefficient C(n-1, 2)
 4&!       Binomial coefficient C(n, 4)
    +      Add them
+          Add that to n and return

05AB1E, 6 bytes
2Ý·scO

Try it online!
Explanation
Straight implementation of the OEIS formula c(n,4) + c(n,2) + c(n,0)
2Ý       # range: [0,1,2]
  ·      # multiply by 2: [0,2,4]
   s     # swap list with input
    c    # combinations
     O   # sum

TI-89 Basic, 57 Bytes
:Def a(a)=Func
:Return nCr(n,0)+nCr(n,2)+nCr(n,4)
:End Func

Throwback to old times.

I'm not sure, but can't you remove the ) on the last nCr?

@Oliver Hi "Not Sure", I am also Not Sure. (Idiocracy is a great movie).

Isn't nCr(n,0) always equal to 1?

Excel, 31 bytes
=(A1^2*(A1-6)+A1*23-18)*A1/24+1

Link to Spreadsheet
Using one of OEIS formulas

Factor + math.combinatorics math.unicode, 29 bytes
[ "\0"[ nCk ] with map Σ ]

Try it online!
You might not be able to see them here, but there are literal 2 and literal 4 control codes embedded in the string. It's a shorter version of { 2 4 0 }. You can see them for sure on TIO.

Actually, 6 bytes
D╣5@HΣ

Try it online!
Explanation:
D╣5@HΣ
D       decrement input
 ╣      push that row of Pascal's triangle
  5@H   first 5 values
     Σ  sum

Vyxal d, 4 bytes
3ʁdƈ

Try it Online!
Simply an implementation of the formula.

Scala, 35 bytes
(n:Int)=>(n*n*(n-6)+23*n-18)*n/24+1

Uses the same formula as numberknot's java answer.

Octave, 27 bytes
@(m)binocdf(4,m-1,.5)*2^m/2

This is an anonymous function.
Try it at Ideone.
Explanation
This is based on the OEIS formula a(m) = C(m−1, 4) + C(m−1, 3) + ... + C(m−1, 0), where C are binomial coefficients. The binomial distribution function

for k = 4, n = m−1 and p = 1/2 gives 2m−1a(m).

@Oliver That would probably end up being longer, because then it's not the distribution function. I would need the probability (mass) function and sum; something like @(m)sum(binopdf(0:2:4,m,.5)*2^m)

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Arranging arbitrary rectangles to fill a space
Can these rectangles fill a rectangular space?
Given a bunch of rectangles, you are asked whether or not they can be arranged to fill a rectangular space.
Specs
Given a bunch of arbitrary m x n rectangles; 0 <= m, n <= 1000, determine whether or not it is possible to arrange them so that they cover exactly a rectangular area without any holes or overlaps. The rectangles cannot be rotated, and each rectangle may only be placed once.
Input
The input for this is very flexible, as long as the input gives some sort of list of 2-space dimensions. For example, both of the following are valid:
Separated by Space, Return
1 2
1 5
4 5
3 6

List of Dimensions
[[1, 2], [1, 5], [4, 5], [3, 6]]
Output
Any sort of true/false values like true/false, 0/1, T/F, True/False, etc. If you are going to use an output method that's not very obvious, please specify in your answer.
Examples
Test Case 1
Input:
1 1
1 5
2 6

Output:
true (or something similar)
How to arrange it:
XYYYYY
ZZZZZZ
ZZZZZZ

Test Case 2
Input:
1 1
2 2

Output:
false (or something similar)
Explanation: It becomes obvious that you cannot arrange two squares of different sizes and get their edges to line up.
Test Case 3
Input:
1 1
1 2
1 2
2 1
2 1

Output:
true (or something similar)
How to arrange it:
AAB
DEB
DCC

As @ETHProductions pointed out, for all of the other test cases, you can keep combining rectangles with a common edge length until you have only one rectangle, so this test case is just to break any code that uses this idea.
Test Case 4
Input:
3 2
4 1
2 1
4 1
2 1
5 2
3 2
1 4
3 2
2 1
2 1
1 1
5 1

Output:
true (or something similar)
How to arrange it:
AAABBBBEE
AAACCDDDD
FFFFFGGGH
FFFFFGGGH
IIIJJKKLH
IIIMMMMMH

Note: You do not need to state how to arrange it, you only need to determine whether not it can be arranged.
This is code golf, so the shortest answer in bytes wins! I will accept the shortest answer as of January 14th, but feel free to submit answers later than that since I can still give upvotes! :)
Happy golfing!
~ A.L.
P.S. If you know what tag should be applied to this problem, please add it, I have absolutely no idea what to put as a tag other than code-golf.
EDIT: Your program should be able to process up to 25 rectangles, in at most 10 seconds on a decent computer (I'll be quite flexible on this rule).
EDIT: I've extended the submission acceptance deadline to the last day of the year, but I doubt I'll get an answer by then...
EDIT: I've extended the submission acceptance deadline by 2 weeks, so if no more answers come in by then, the current C answer will be accepted! :)

I take it each input rectangle be used only once?

Why is there a deadline?  You could say that you'll accept an answer at that time, but challenges should be open indefinitely :)

Also, you should indicate that "tiling" means placing each rectangle down exactly once.  If you allow multiple placements, then any tiling is valid.

Can the rectangles be rotated?

@NathanMerrill That's what I meant. :) I'll clarify in the question.

@NathanMerrill That is true. As xnor asked as well, each rectangle can only used once so I will clarify.

@xnor No, they cannot. I will clarify.

@PeterTaylor That is true. I will change the wording; see if it's a bit more clear what the question is.

upvoted because I'm tearing my hair out trying to get any code to work, not just golfed.

@GabrielBenamy Yeah, I have no idea even how to do this. :P

Well, your problem is a decidability problem: "can these oriented rectangles be arranged to form another rectangle with 0 waste", which is an NP-complete problem (Korf, 2003: https://pdfs.semanticscholar.org/90a5/de6349bed23e94f23985867f79c87a68e4a6.pdf ).  Korf's algorithm is essentially a brute-force with some optimizations to more efficiently eliminate configurations with no solution.  I doubt a golf of this would be below 250 characters in most languages.

@GabrielBenamy Okay, that makes sense. Thank you for the resource.

The easy route would be to determine whether you can repeatedly combine two rectangles of the same width or height until you have 1 rectangle left. This algorithm works for all of the current testcases; however, it fails for [[1, 2], [2, 1], [1, 1], [1, 2], [2, 1]] (which can be arranged ABB ACD EED). You may want to add this simple test case.

@ETHproductions I was talking to one of the other students in my Grade 9 Science class, and he gave the same idea, and I gave him the exact same counter-example, which is quite coincidental... :P I'll add it. Thanks for pointing that out.

So, I've made a solution. The problem is that it takes too long, because it's just brute-forcing everything, which is a terrible idea.

C, 1135 1158 1231 1598 bytes
Well, it's past the stated deadline, but seeing as how there are no answers yet, here's one (a bit long) in C.
Returns:

0 (zero) on failure (don't fit)
Full fitting matrix on success

Update:
Original code could get stuck on some matrices, taking much longer than the allowed 10s.  Current revision should complete all matrices in under 1s.  This is accomplished by 1) Sorting the input rectangles and 2) skipping repeated sizes when fitting.
Golfed:
#define R r[i]
#define Z return
#define _(B,D,E) for(int B=E;B<D;B++)
struct{int x,y,u,p;}r[25],*S;int A,M,N,U,V,X,Y;char *P;T(x,y,w,h){_(I,x+w,x)_(J,y+h,y)if(I/U|J/V|P[J*U+I])Z 0;Z 1;}L(x,y,w,h,c){_(I,x+w,x)_(J,y+h,y)P[J*U+I]=c;}F(){int x=0,y;while(++x<A)if(!P[x])break;if(x/A){_(i,V,0)printf("%*.*s\n",U,U,P+i*U);exit(0);}y=x/U;x-=y*U;_(i,N,0)if(!R.u&T(x,y,R.x,R.y))R.u=1,L(x,y,R.x,R.y,'A'+i),F(),R.u=0,L(x,y,R.x,R.y,0);}O(i,y){if(!R.u){if(!T(0,y,R.x,R.y))Z;R.u=1;R.p=0;L(0,y,R.x,R.y,'A'+i);y+=R.y;}if(y-V||F())_(j,N,0)if(j-i&!r[j].u){O(j,y);while(r[j].x-r[j+1].x|r[j].y-r[j+1].y)j++;}R.u=0;L(R.p,(y-=R.y),R.x,R.y,0);}Q(i,x){if(!R.u){if(R.x>U-x)Z;R.u=1;R.p=x;L(x,0,R.x,R.y,'A'+i);x+=R.x;}if(x-U||O(i,1))_(j,N,0)if(j-i&!r[j].u)Q(j,x);L(x-=R.x,0,R.x,R.y,0);R.u=0;}C(int*a,int*b){Z*a-*b?*a-*b:a[1]-b[1];}main(){_(i,25,0)if(++N&scanf("%d%d\n",&R.x,&R.y)-2)break;_(i,N,0){A+=R.x*R.y;if(R.x>X)X=R.x;if(R.y>Y)Y=R.y;}_(i,A+1,1)if(!(A%i)){if(i<Y|A/i<X)continue;M++;S=realloc(S,M*16);S[M-1].y=i;S[M-1].x=A/i;}qsort(S,M,16,C);P=calloc(A+1,1);_(j,M,0){U=S[j].x;V=S[j].y;_(i,N,0)R.u=1,L(0,0,R.x,R.y,'A'+i),Q(i,R.x),R.u=0;}printf("0\n");exit(1);}

UnGolfed:
#define R r[i]
#define Z return
#define _(B,D,E) for(int B=E;B<D;B++)
struct {
    int x,y,u,p;
} r[25],*S;
int A,M,N,U,V,X,Y;
char *P;

test_space(x,y,w,h) {
    _(I,x+w,x)
        _(J,y+h,y)
            if (    I >= U |
                    J >= V |
                    P[J*U+I]) Z 0;
    Z 1;
}
place_rect(x,y,w,h,c){
    _(I,x+w,x)
        _(J,y+h,y)P[J*U+I] = c;
}

fill_rest() {
    int x=0,y;
    while(++x<A) if (!P[x])break;
    if (x>=A) {
        _(i,V,0) printf("%*.*s\n", U,U, P+i*U);
        exit(0);
    }
    y = x / U; x -= y*U;

    _(i,N,0)
        if (!R.u & test_space(x, y, R.x, R.y))
                R.u = 1,
                place_rect(x, y, R.x, R.y, 'A'+i),
                fill_rest(),
                R.u = 0,
                place_rect(x, y, R.x, R.y, 0);

}

fill_y(i,y) {
    if (!R.u) {
        if (!test_space(0, y, R.x, R.y)) Z;
        R.u = 1;
        R.p = 0;
        place_rect(0, y, R.x, R.y, 'A'+i);
        y += R.y;
    }
    if (y == V) fill_rest();
    else _(j,N,0)
        if (j!=i && !r[j].u){ fill_y(j, y);
        while (r[j].x^r[j+1].x||r[j].y^r[j+1].y)j++;
        }
    R.u = 0;
    place_rect(R.p, (y -= R.y), R.x, R.y, 0);
}

fill_x(i,x) {
    if (!R.u) {
        if (R.x > U - x) Z;
        R.u = 1;
        R.p = x;
        place_rect(x, 0, R.x, R.y, 'A'+i);
        x += R.x;
    }
    if (x == U) fill_y(i, 1);
    else
        _(j,N,0)
            if (j!=i && !r[j].u) fill_x(j, x);
    place_rect((x -= R.x), 0, R.x, R.y, 0);
    R.u = 0;
}
C(int*a,int*b) {
    Z *a^*b?*a-*b:a[1]-b[1];
}

main() {
    _(i,25,0)
        if (++N&&scanf("%d %d\n", &R.x, &R.y)!=2) break;
    _(i,N,0){
        A+=R.x*R.y;
        if(R.x>X)X=R.x;
        if(R.y>Y)Y=R.y;
    }
    _(i,A+1,1)
        if (!(A%i)) {
            if (i < Y | A/i < X) continue;
            M++;
            S = realloc(S,M*16);
            S[M-1].y=i;
            S[M-1].x=A/i;
        }
    qsort(S, M, 16,C);
    P = calloc(A + 1,1);
    _(j,M,0){
        U = S[j].x; V = S[j].y;
        _(i,N,0)
            R.u = 1,
            place_rect(0, 0, R.x, R.y, 'A'+i),
            fill_x(i, R.x),
            R.u = 0;
    }
    printf("0\n");
    exit(1);
}

Explanation:
We have 6 functions: main, O, Q, F, L and T.  T tests to see if there is space for the rectangle at a given spot.  L fills a rectangle into the output buffer or, alternately removes one by overwriting it. O and Q build up the left and top walls, respectively and F fills the remainder of the rectangle by iterative search.
Although the basic search is iterative, we eliminate the vast majority of possible search vectors, first by building up the allowed combinations of width and height for the master rectangle and then eliminating impossible configurations.  Additional speed could be gained in larger rectangles by determining bottom and right walls prior to filling the center but it is not required for decent speed when limiting to 25 interior rectangles.

Nice job! It appears to be working... However, could you specify your output format? It appears that it's printing stuff if it works and crashing if it doesn't, which I'll permit since this is the only answer anyway. Also, you can save quite a few bytes by printing "1" instead of "Everybody fits!" (because that's allowed), and also quite a few bytes by not printing how they're arranged. It's nice to have that printed, but it uses unnecessary bytes, and the purpose is to save on that. Otherwise, good job! I'm extending the deadline by half a month, but for now, have an upvote. :)

Thanks.  I updated to specify the format and fixed the crash (that was unintentional).  I left the matrix output (+30bytes) because it's nifty and if someone else posts a golf-language solution, they won't just be beating me by 30 :)

-367 bytes... Possibly the largest golf ever? :-)

:-)  Well, it helps to have a hack-y starting point.

Sure does! My largest golf was 337 characters in Java over several edits, and I started out with some pretty terrible ideas (oh, the good old days when I would create 50 million variables and only need 2...). Anyway, I'll keep waiting for answers, but it looks like this may be the only working one!

Good job, your solution is the only one existing so far. Have +15 rep. :)

Thanks!  As a wise man once said "the two sweetest words in the English language! de fault!"

1060 bytes

Haskell, 226 bytes
((y,z):l)&(w,x)|x*y<1=(w+y,x+z):l
(q:l)&p=p:q:l
(p@(u,v):r@(y,z):l)%q@(w,x)=[((y-w,z):l)&q&(u,v-x)|w<=y,x<=v]++[p:m|m<-(r:l)%q]
_%_=[]
g m(p:n)l=any(g[]$m++n)(l%p)||g(p:m)n l
g[]_[_,_,_]=0<1
g _[]_=0<0
($[(0,9^9),(9^9,0)]).g[]

Try it on Ideone
How it works
This recursively searches for all partial tilings whose shape is a Young diagram, adding one rectangle at a time, and checks whether any of the final results are rectangles.
To see that any tiling of a rectangle can be built this way: in any tiling of a nonempty Young diagram, let R be the set of rectangles in the tiling whose southwest corner does not touch any other rectangle.  Since each concave vertex of the Young diagram is edge-adjacent (not merely corner-adjacent) to at most one rectangle in R, and the number of these concave vertices is one less than the number of rectangles in R, there must be at least one rectangle in R that is edge-adjacent to none of these concave vertices.  Removing it yields another Young diagram, so we can proceed by induction.

Nice one! This is fantastic. Good job! :)


text:
Find the maximum deviation
This problem is "inspired" from a question that was originally asked on Quora (not for code golfing). I just want to make it a challenge for you guys (and my first problem submission here).
Given an array of integer elements v and an integer d (we assume that d is lower or equal to the array's length), consider all the sequences of d consecutive elements in the array. For each sequence, compute the difference between the maximum and minimum value of the elements in that sequence and name it the deviation.
Your task is to write a program or function that computes the maximum value among all deviations of all the sequences considered above, and return or output that value.
Worked-through Example:
v: (6,9,4,7,4,1)
d: 3

The sequences of length 3 are:
6,9,4 with deviation 5
9,4,7 with deviation 5
4,7,4 with deviation 3
7,4,1 with deviation 6

Thus the maximal deviation is 6, so the output is 6.

This is code golf, so the shortest answer in bytes wins.

Dyalog APL, 7 bytes
⌈/⌈/-⌊/

Test it on TryAPL.
How it works
⌈/⌈/-⌊/  Dyadic chain. Left argument: d. Right argument: v

     ⌊/  Reduce v by d-wise minimum, yielding the minima of all slices of length d.
  ⌈/     Reduce v by d-wise maximum, yielding the maxima of all slices of length d.
    -    Subtract, yielding the ranges of all slices of length d.
⌈/       Take the maximum.

JavaScript (ES6), 73 bytes
with(Math)(v,d)=>max(...v.map((a,i)=>max(...a=v.slice(i,i+d))-min(...a)))

+1 for TIL that you can use with on an entire lambda function

Actually, Uncaught SyntaxError: Unexpected token with. Can you post a working snippet?

@BassdropCumberwubwubwub If you want to name the lambda you need to put the assignment after the with(Math), or use f=eval("with(Math)(v,d)=>max(...a)))").

Python, 60 bytes
Saving 5 bytes thanks to Neil
f=lambda v,d:v and max(max(v[:d])-min(v[:d]),f(v[1:],d))or 0

My first recursive lambda!
Usage:
print f([6,9,4,7,4,1], 3)

I think you can just use v and; the range isn't going up if you remove elements.

R, 63 62 56 bytes
Billywob has already provided a great R answer using only the base functions. However, I wanted to see if an alternative approach was possible, perhaps using some of R's extensive packages. There's a nice function rollapply in the zoo package designed to apply a function to a rolling window of an array, so that fits our purposes well. We use rollapply to find the max of each window, and we use it again to find the min of each window. Then we take the difference between the maxes and mins, which gives us the deviation for each window, and then return the max of those.
function(v,d)max((r=zoo::rollapply)(v,d,max)-r(v,d,min))

Nice, I knew there was a function for generating the subsequences but couldn't find it. Also behind a proxy at work so can't use any external packages.

Some googling informs me that there's also gtools::rolling, but that's one more byte and I'm not familiar with it. I'm always in two minds about using non-base packages: on the one hand, it feels like cheating when there's a simple solution; on the other hand, the packages (and the community) are one of R's strengths as a language, I think.

Perl, 48 bytes
Includes +5 for -0pi
Give the width after the -i option, give the elements as separate lines on STDIN:
perl -0pi3 -e '/(^.*\n){1,$^I}(?{\$F[abs$1-$&]})\A/m;$_=$#F'
6
9
4
7
4
1
^D

Just the code:
/(^.*\n){1,$^I}(?{\$F[abs$1-$&]})\A/m;$_=$#F

(use a literal \n for the claimed score)

I see a regex, and then I get lost. 0.0 What's going on here?

@VTCAKAVSMoACE Basically I match 1 to width consecutive lines. $& will contain the whole match which will evaluate as the first number in arithmetic context. $1 will contain the last number. I then forcefully fail the regex with \A. So it will try all starting positions and lengths up to width. I use absolute value of the difference as an array index and see how big the array grows. Perl has no builtin max so I have to improvise

That's extremely clever. Any way you can put the -0pi3 -e into -0pi3e? Just an assumption about a possible reduction, I don't use perl (thus my question).

@VTCAKAVSMoACE No unfortunately. -i eats everything after it as its value, including any e

And I'm assuming that -e has to go just before the code? Bummer.

I count 44 + 5 bytes, not 43 + 5.

@VTCAKAVSMoACE Use literal newline for \n which is only 1 byte

Husk, 13 7 bytes
▲m§-▼▲X

Try it online!
-6 bytes from Jo King.
Explanation
▲m§-▼▲X Slices of length n
 m      map to
  §-    difference between
    ▼▲  min and max
▲       take the maximum of that

@JoKing Imagine reading documentation

R, 80  77 bytes bytes
Edit: Saved 3 bytes thanks to @rturnbull
function(s,d)max(sapply(d:sum(1|s)-d+1,function(i)diff(range(s[i:(i+d-1)]))))

You can replace 1:(length(s)-d+1) with d:sum(1|s)-d+1.

@rturnbull Nice catch!

Mathematica, 41 37 bytes
Max[MovingMap[MinMax,#,#2-1].{-1,1}]&

Couldn't you use the dot product with {-1,1} to avoid the Abs?

@miles Thanks! Edited answer.

@JHM One byte saved with Max[BlockMap[MinMax,#,#2,1].{-1,1}]&.

05AB1E, 12 10 bytes
Uses CP-1252 encoding.
Œù€{øÀ`-ÄZ

Try it online!
Explanation
Œ              # sublists of v
 ù             # of length d
  €{           # sort each
    ø          # zip
     À         # rotate left (last 2 lists will be largest and smallest)
      `        # flatten (lists with smallest and largest item will be on top)
       -       # subtract largest from smallest
        Ä      # take absolute value (as we will have negatives after the previous step)
         Z     # take the largest

PowerShell v2+, 68 bytes
param($v,$d)($v|%{($x=$v[$i..($i+++$d-1)]|sort)[-1]-$x[0]}|sort)[-1]

Iterative solution. Loops through $v, but really we're just using that as a counter rather than actually going through the values. Each iteration, we're slicing $v by $i..($i+++$d-1), where $i defaults to 0. We |sort those elements, and store the result into $x. Then we take the biggest [-1] and subtract the smallest [0]. We then |sort those results and take the biggest [-1] of that. That number is left on the pipeline and output is implicit.
Examples
PS C:\Tools\Scripts\golfing> .\find-the-maximum-deviation.ps1 @(6,9,4,7,4,1) 3
6

PS C:\Tools\Scripts\golfing> .\find-the-maximum-deviation.ps1 @(1,2,3,4,5,6) 3
2

PS C:\Tools\Scripts\golfing> .\find-the-maximum-deviation.ps1 @(7,2,3,4,5,6) 3
5

Ruby, 45 bytes
->a,d{a.each_cons(d).map{|b|b.max-b.min}.max}

I feel like this could be a lot better.

Scala, 48 bytes
(_:Seq[Int])sliding(_:Int)map(s=>s.max-s.min)max

Ungolfed:
(a:Seq[Int],d:Int)=>a.sliding(d).map(s=>s.max-s.min).max

Explanation:
(_:Seq[Int])   //define a function with a seq of ints as an argument
sliding(_:Int) //get the sequences with the length of an int argument
map(s=>        //map each sequence
  s.max-s.min    //to its deviation
)max           //and take the maximum value

Java 8, 140 128
Shaved a bunch off, in part thanks to VTCAKAVSMoACE.
int l(int[]a,int d){int x=0,i=0,f,j,k;for(;i<=a.length-d;i++)for(j=i;j<i+d;j++)for(k=i;k<i+d;)x=(f=a[j]-a[k++])>x?f:x;return x;}

Ungolfed
int l(int[]a,int d){
    int x=0,i=0,f,j,k;
    for(;i<=a.length-d;i++)
        for(j=i;j<i+d;j++)
            for(k=i;k<i+d;)
                x=(f=a[j]-a[k++])>x?f:x;
    return x;
}

You're missing a end bracket. ;)

@VTCAKAVSMoACE oops. Copy and paste error :(

5 byte reduction: int l(int[]a,int d){int x=0,i=0,f,j,k;for(;i<=a.length-d;i++)for(j=i;j<i+d;j++)for(k=j;k<i+d;)x=(f=a[j]-a[k++])<0?-f:f>x?f:x;return x;}

@VTCAKAVSMoACE I don't believe what you have will work- could be wrong. Try switching the 7 and the 1 in the test case. However, I can use it to shave a few off my new idea!

I got rid of the need for abs (making the algo much worse in the process, of course) by starting k at i as well. Pretty nifty trick having x=(f=...) in the same line, thanks for that

Shaved a byte (this doesn't work, but it might lead to something new): int l(int[]a,int d){int x=-1,i=x,f,j,k;for(;i++<a.length-d;)for(j=i;j<i+d;j++)for(k=i;k<i+d;)x=(f=a[j]-a[k++])>x?f:x;return x;}

Factor + math.statistics, 32 bytes
[ clump [ range ] map supremum ]

Try it online!

clump Get the windows of [first input] of length [second input]
[ range ] map Map each window to its 'deviation' (which Factor calls range)
supremum Maximum element

PowerShell, 70 bytes
(0..(-$d+$v.count)|%{$s=$v[$_..($_+$d-1)]|sort;$s[-1]-$s[0]}|sort)[-1]

Try it online!

05AB1E, 8 bytes
ŒIùεW-}à

Inputs in the order \$v,d\$.
Try it online.
Explanation:
Œ       # Get all sublists of the first (implicit) input-list `v`
 Iù     # Only keep those with a length equal to the second input-integer `d`
   ε    # Map over each d-sized sublist:
    W   #  Push the minimum of the current sublist (without popping the list)
     -  #  Subtract this minimum from each value in the list
   }à   # After the map: pop and push the flattened maximum
        # (which is output implicitly as result)

The map εW-} could alternatively be D€ß- for a vectorized subtraction.

MATL, 10 bytes
YCS5LY)dX>

Try it online!
Explanation
Consider inputs [6,9,4,7,4,1], 3 as an example.
       % Implicitly take the two inputs: v, d
       % STACK: [6,9,4,7,4,1], 3
YC     % Matrix of overlapping d-blocks of v
       % STACK: [6 9 4 7
                 9 4 7 4
                 4 7 4 1]
S      % Sort each column
       % STACK: [4 4 4 1
                 6 7 4 4
                 9 9 7 7]
5LY)   % Keep first and last rows
       % STACK: [4 4 4 1
                 9 9 7 7]
d      % Differences along each column
       % STACK: [5 5 3 6]
X>     % Maximum
       % STACK: 6
       % Implicitly display

MATLAB with Statistics and Image Processing Toolboxes, 33 bytes
@(v,d)max(range(im2col(v,[1 d])))

This defines an anonymous function. Example use:
>> f = @(v,d)max(range(im2col(v,[1 d])));
>> f([6,9,4,7,4,1], 3)
ans =
     6

You can also try it on Octave at Ideone (but Octave, unlike Matlab, requires explicitly loading the image package).
Explanation
im2col(v,[1 d]))   % Takes overlapping blocks of size d from v, and arranges them as
                   % columns of a matrix
range(...)         % Maximum minus minimum of each column. Gives a row vector
max(...)           % Maximum of the above row vector

PHP, 89 87 bytes
for($i=1;$r=array_slice($argv,++$i,$argv[1]);$d=max($r)-min($r))$o=$d>$o?$d:$o;echo+$o;

Not particularly clever or pretty but it works. Use like:
php -r "for($i=1;$r=array_slice($argv,++$i,$argv[1]);$d=max($r)-min($r))$o=$d>$o?$d:$o;echo+$o;" 3 6 9 4 7 1

for v=6,9,4,7,4,1, d=3
Edit: 2 bytes saved thanks to Jörg Hülsermann

echo+$o; instead of echo$o?:0;

Java 7,159 bytes
Java = expensive(i know it can be golfed much more)
int c(int[]a,int d){int[]b=new int[d];int i,j,s=0;for(i=-1;i<a.length-d;){for(j=++i;j<i+d;)b[i+d-1-j]=a[j++];Arrays.sort(b);s=(j=b[d-1]-b[0])>s?j:s;}return s;}

Ungolfed
static int c ( int []a , int d){
    int []b = new int[ d ];
    int i , j , s = 0 ;
    for ( i = -1 ; i < a.length - d ;) {
        for ( j = ++i ; j < i + d ;)
        b[ i + d - 1 - j ] = a[ j++ ] ;
        Arrays.sort( b ) ;
        s = ( j = b[ d - 1 ] - b[ 0 ] ) > s ? j : s ;
    }
    return s ;
    }

Jelly, 8 bytes
ṡµṂ€ạṀ€Ṁ

Try it online!
Uses the same algorithm as Dyalog APL, but I figured this myself before looking at it.
Explanation:
ṡµṂ€ạṀ€Ṁ ḷ“Main link. Arguments: v d.”
ṡ        ḷ“Overlapping sublists of x of length y.”
 µ       ḷ“Start a new monadic chain.”
  Ṃ€ạṀ€  ḷ“Find the deviation of each of the elements of x.”
       Ṁ ḷ“Take the maximum of x.”

Note: x, y are left, right arguments respectively.

Brachylog, 10 bytes
s₎ᶠ⟨⌉-⌋⟩ᵐ⌉

Try it online!

Arturo, 59 bytes
$[a,n][max map 0..-size a n'x[z:a\[x..x+n-1](max z)-min z]]

Try it

Japt -h, 12 bytes
ãV mÍ®Ì-ZÎÃÍ

Try it
ãV     # subsequences of length V
mÍ     # sort each, ascending
®Ì-ZÎÃ # map each to last - first
Í      # sort, ascending
# -h flag prints the last element

Desmos, 62 58 bytes
r=v[i-d+1...i]
f(v,d)=[r.max-r.minfori=[d...v.length]].max

Try it on Desmos!
-4 bytes thanks to Aiden Chow

60 bytes

Wait actually 58 bytes

You didn't change the code box. It's still the same as your original answer.

Vyxal G, 12 bytes
ÞS'L⁰=;ƛG$g-

Try it Online!
Explanation
ÞS'L⁰=;ƛG$g-  # Implicit input
ÞS            # All sublists of the first input
  '   ;       # Filtered by the following:
   L          #  The length of the sublist
    ⁰=        #  Equals the second input
       ƛ      # Map over the filtered list:
        G     #  Push the maximum of the sublist
         $g   #  Swap and push the minimum
           -  #  Subtract to find the deviation
              # G flag gets the maximum of this list
              # Implicit output

Uiua, 10 bytes
/↥-⊃/↧/↥⍉◫

Try it!
/↥-⊃/↧/↥⍉◫
         ◫  # windows
        ⍉   # transpose
   ⊃/↧/↥    # maxes and mins of each column
  -         # subtract
/↥          # maximum

CJam, 17 bytes
q~ew{$)\(\;-}%:e>

(Also q~ew:$z)\(\;.-:e>)
Try it online!
Explanation
q~                   e# Read the two inputs. Evaluate
  ew                 e# Overlapping blocks
    {       }%       e# For each block
     $               e# Sort
      )              e# Get last element (that is, maximum)
       \(            e# Swap, get first element (minimum)
         \;          e# Swap, delete rest of the block
           -         e# Subtract (maximum minus minimum)
              :e>    e# Maximum of array

Haskell, 56 bytes
_#[]=0
d#l|m<-take d l=max(maximum m-minimum m)$d#tail l

Usage example: 3 # [6,9,4,7,4,1] -> 6.
Considering ranges less than d doesn't change the overall maximum, so we can run take d down to the very end of the list (i.e. also include the ranges with the last d-1, d-2, ... 0 elements). The recursion stops with the empty list where we set the deviation to 0.

Actually, 13 bytes
╗╜@V`;m@M-`MM

Try it online!
-6 bytes from the observation in nimi's Haskell answer, that slices shorter than d don't affect the maximum deviation.
Explanation:
╗╜@V`;m@M-`MM
╗              store d in register 0
 ╜@            push d, swap so v is on top
   V           push all slices of v whose length is in [1, d]
    `;m@M-`M   map (for each slice):
     ;m@M-       get minimum and maximum, subtract min from max
           M  get maximum of list of deviations

Java, 126 bytes
I got inspired by dpa97's answer and found this:
int f(int v[],int d){int m=0,i=0,j,t,l=v.length;for(;i<l;i++)for(j=i;j<l;j++)m=j-i<d&&(t=Math.abs(v[i]-v[j]))>m?t:m;return m;}

Expanded, golfed and example code

Racket 121 bytes
(let p((v v)(j 0))(let*((l(take v d))(k(-(apply max l)(apply min l)))
(j(if(> k j)k j)))(if(= d(length v))j(p(cdr v)j))))

Ungolfed:
(define (f d v)
  (let loop ((v v)
             (mxdev 0))                     ; start with max deviation as 0
    (let* ((l (take v d))                   ; take initial d elements in v
           (dev (- (apply max l)            ; find deviation
                    (apply min l)))
           (mxdev (if(> dev mxdev)          ; note max deviation
                   dev
                   mxdev)))
      (if (= d (length v)) mxdev            ; if all combinations tested, print max deviation
          (loop (rest v) mxdev))            ; else test again
      )))                                   ; with first element of list removed

Testing:
(f 3 '(6 9 4 7 4 1))

Output:
6

q, 25 bytes
{max mmax[y;x]-mmin[y;x]}

mmax and mmin are sliding window maximum and minimum respectively
Example
q){max mmax[y;x]-mmin[y;x]}[6 9 4 7 4 1;3]
6

C#, 131 bytes
here is a verbose linq solution
int c(int[]a){var x=from j in Enumerable.Range(0,a.Length-2)let p=new[]{a[j],a[j+1],a[j+2]}select p.Max()-p.Min();return x.Max();}

 C#, 163 bytes
Golfed:
int m(List<int> v,int d){var l=new List<List<int>>();for(int i=0;i<v.Count;i++){if(v.Count-i>=d)l.Add(v.GetRange(i,d));}return l.Select(o=>o.Max()-o.Min()).Max();}

Ungolfed:
public int m(List<int> v, int d)
{
  var l = new List<List<int>>();

  for (int i = 0; i < v.Count; i++)
  {
    if (v.Count - i >= d)
      l.Add(v.GetRange(i, d));
  }

  return l.Select(o => o.Max() - o.Min()).Max();
}

Test:
var maximumDeviation = new MaximumDeviation();
Console.WriteLine(maximumDeviation.f(new List<int> {6,9,4,7,4,1}, 3));

Output:
6

Clojure, 73 67 bytes
Edit: Using #(...) instead of (fn[...]) and for instead of map.
#(apply max(for[p(partition %2 1 %)](-(apply max p)(apply min p))))

Pyth, 11 bytes
eSms.+Sd.:F

Explanation
eSms.+Sd.:FQ   Implicit input
          FQ   Unpack the input (v, d)
        .:     Get all subsequences of length d
  m   Sd       Sort each
   s.+         Take the sum of differences to get the deviation
eS             Get the maximum

Perl 6, 44 bytes
{$^a.rotor($^b=>1-$^b).map({.max-.min}).max}

$^a and $^b are the two arguments to the function, called v and d respectively in the problem statement.  The rotor method returns the sequence of subsequences of v of size d.

Python 3, 80 bytes
lambda v,d:max(map(lambda g:max(g)-min(g),[v[i:i+d]for i in range(-~len(v)-d)]))

you can use (max(v[i:i+d])-min(v[i:i+d])for i in range(-~len(v)-d) instead of map(lambda g:max(g)-min(g),[v[i:i+d]for i in range(-~len(v)-d)])

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Output the ALONED numbers
Consider the natural sequence up-to 6 (disregard 1):
2,3,4,5,6

We start scanning from the left (in this case from 2), search for a number divisible by 2 (here 4) and then remove both the numbers from the list (here 2 & 4), such that the list reduces to:
3,5,6

We continue the same process, here leftmost is 3, so we search for number divisible by 3. 6 is surely that number and thus 3 and 6 are removed,
5

Now, no further such searches can be made Thus, this becomes the list of ALONED numbers for n=6.
OBJECTIVE

Given a number n greater than 1, print all the corresponding aloned numbers.

INPUT
2
6
15
20
22

OUTPUT
2
5
8,9,11,12,13,15
11,12,13,15,17,19,20
12,13,15,17,19,20,21

YET ANOTHER WORKED OUT EXAMPLE
For n= 22
=>2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22
=>3,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22 (remove 2 & 4)
=>5,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22 (remove 3 & 6)
=>7,8,9,11,12,13,14,15,16,17,18,19,20,21,22 (remove 5 & 10)
=>8,9,11,12,13,15,16,17,18,19,20,21,22 (remove 7 & 14)
=>9,11,12,13,15,17,18,19,20,21,22 (remove 8 & 16)
=>11,12,13,15,17,19,20,21,22 (remove 9 & 18)
=>12,13,15,17,19,20,21 (remove 11 & 22) (OUTPUT)

This is code-golf, so the shortest code in bytes wins.

Just so you know, we have a sandbox where you can post incomplete challenges for feedback before posting it to the main site.

Do we have to return a list of the numbers in ascending order or would an unordered list or a set be acceptable as well?

should be in ascending order.

05AB1E, 22 17 15 14 bytes
L¦¹F¬·©¹›_i¦®K

Try it online!
Explanation
L¦               # push the list [2..input]
  ¹F             # input nr of times do:
          i      # if
    ¬·©          # the first element in the list * 2
       ¹›_       # is less than or equal to input
                 # then
           ¦     # remove first element of list
            ®K   # and remove it's multiple

Python 2, 90 79 73 bytes
-6 bytes thanks to xnor
L=range(2,input()+1)
while L[0]*2<=L[-1]:L.remove(L[0]*2);L=L[1:]
print L

Takes the input number on stdin. Ideone it!
Explanation
We construct the initial list from the input number and store it in L. Next, loop while the last number is greater than or equal to 2 times the first number and remove 2 times the first number from the list. This will always be the next number divisible by L[0]. L=L[1:] takes off the first number as well. When the condition is no longer true, no further removals can be made, and the list is printed.

In Python 2, range already gives a list.

@xnor Thanks! Forgot about that.

Python, 61 bytes
lambda n:[i+1for i in range(n/2,n)if-~i&~i&4**n/3>>(-~i&i<1)]

It's a bit easier to understand this less golfed code:
lambda n:[i for i in range(n/2+1,n+1)if((i&-i)**.5%1>0)^(i&~-i>0)]

This uses a direct characterization of aloned numbers:

A number i is aloned if, when decomposed as i = a * 2^b with b odd, either

a>1 and b is even, or
a==1 and b is odd

The aloned numbers for n are all aloned numbers i in the interval n/2 + 1 <= i <= n.

Why does this hold? When doing the process for n, say we remove an odd number a in the lower half (1 to n/2). Then, 2*a is removed no matter where in the list it is. So, 4*a remains (if it existed). But if it's in the lower half, the deletion process will get to it and remove both 4*a and 8*a. So, we see that an upper-half number gets removed if it's of form 2*a, 8*a ... with odd c, but stays if it has form a, 4*a, 8*a, ...
The exception is for a=1, which does not start in the list and so is not removed. As a result, the removal chain starts with a=2, and the rule for powers of 2 is flipped.
lambda n:[i for i in range(n/2+1,n+1)if((i&-i)**.5%1>0)^(i&~-i>0)]

In the code above, (i&-i)**.5%1>0 checks whether i lacks the form i = a * 2^b with b odd, by the bit-trick to extract the greatest power-of-two factor, 2^b = i&-i, then checking if the result is not a perfect square. Then, i&~-i>0 is another bit trick to check if i is not a perfect power of 2. These conditions are then xor'ed.
There's some more improvements here
lambda n:[i+1for i in range(n/2,n)if-~i&~i&4**n/3>>(-~i&i<1)]

First, we shift the range 1 index down to to shorten to range(n/2,n) from range(n/2+1,n+1), compensating by replacing all i with i+1 (or ~-i).
Whether a power of 2 is number is a power of 4 (2^b with b even) can be checked by and-ing with 2**c/3 for some large c. This is because 2**c/3 has binary representation 10101...101 with ones in the even-positioned bits. Using c=2*n suffices. To negate result when i is a power of 2, we halve this number is that case, putting 1's in the odd positions instead.

Groovy, 65 58 Bytes
Algorithm idea from DSLoc, who noticed you need only to remove the doubles.
{n->a=(2..n);(2..(n/2)).each{if(it in a){a-=[it,it*2]}};a}

Here's a breakdown:
{
    n->
    a=(2..n);             // Store [2,...,n].
    (2..(n/2)).each {     // From 2 to half of n.
        if(it in a){      // If it's there...
            a-=[it,it*2]  // Remove it and its double, store in a.
        }
    };
    a                     // Return a.
}

Perl, 53 49 45 44 bytes
Includes +1 for -n
Give input number on STDIN:
perl -M5.010 aloned.pl <<< 22

aloned.pl:
#!/usr/bin/perl -n
@F[$F[$_*2]/2,$_*2,1]=0,$_&&say for@F=0..$_

Directly checking the possible numbers is longer:
map{/$/;$_/=4until$_%4;$_%2^$_<3&&say$`}$_/2+1..$_

This checks all numbers in the upper half range. Keep numbers that have an even number of 2 as prime factors except if the number is a power of 2 then odd (because 1 is left out of the original series). This method should however work well for other languages.

Haskell, 71 69 62 56 bytes
g(a:b)|s<-filter(/=2*a)b=[a|s==b]++g s
g x=x
q n=g[2..n]

Usage example: q 22 -> [12,13,15,17,19,20,21].
If there's a multiple of the first number a, then it's 2*a. Keep a if 2*a is not in the list and append a recursive call with a and 2*a removed from the list.

Hehe, I was going to tell you that GCD was overkill, but you got it yourself.

MATL, 18 bytes
Borrowed the "multiply by 2" idea from @Emigna's 05AB1E answer.
q:Qt"t1)tEhym?6MX-

Try it online!
Explanation
q:Q        % Input n implicitly. Push [2 3 ... n]
t"         % Duplicate. For each: repeat n-1 times
  t1)      %   Duplicate. Get first element from current array, say k
  tEh      %   Append twice that value: gives array [k 2*k]
  y        %   Push another copy of current array
  m?       %   If both k and 2*k are members of the array
    6M     %     Push [k 2*k] again
     X-    %     Set difference: remove from current array
           %   End if implicitly
           % End for each implicitly
           % Display implicitly

You need only check if k is a member, don't know if that saves you a bytes or not.

@carusocomputing Thanks! I initially checked only 2*k (if that's what you mean). Then I added k there because later on I reuse that array of two elements to remove both from the general array

Pyth - 19 bytes
Will definitely be refactoring.
u?Kf!%ThGtG-tGhKGtS

Test Suite.

Ruby, 124
Comparing scores to other answers, this is obviously the wrong approach:
->n{a={};b=[*2..n].each{|k|a[k]=7}
b.map{|i|g=b.select{|x|a[i]&&a[x]&&x%i<1}
a[g[0]]=a[g[1]]=!g[1]}
a.select{|k,v|v&k}.keys}

The somewhat clever bit here is a[g[0]]=a[g[1]]=!g[1] which sets the hash's values to true/false as necessary.

PHP, 98 Bytes
foreach($r=range(2,$argv[1])as$v)$a=&$r[$v-2]&&$b=&$r[$v*2-2]?$b=$a="":(!$a?:print$x?",$a":$x=$a);

8 Bytes save by @Titus Thank You
If a trailing comma is allowed then it can be shorten 9 Bytes
(!$a?:print"$a,"); instead of (!$a?:print$x?",$a":$x=$a);

Don´t the assignments to $a and $b need parentheses? Wicked!

-1 byte with the trailing comma: (!$a?:print"$a,") -> print$a?"$a,":"". -2 bytes for both versions if you use the underscore as separator.

-2 bytes: foreach(... as$v), $v-2 instead of $k and $v*2-2 instead of $k*2+2.

@Titus I have tried it after you comment $a=&$r[$k]&&$b=&$r[$k*2+2] works like $a=$r[$k]and$b=$r[$k*2+2]. I am sorry about I found no page which explains combinations with references and the && operator. But I need references not assignments. I'm not sure if a trailing comma or an other separator is allowed.

@Titus  found it now http://php.net/manual/en/language.operators.precedence.php & bitwise and references haves a higher Precedence then the && operator

Yea; they finally updated my favorite page in the manual; but I didn´t notice that until now. You can still take the two bytes. ;)

and -6 bytes: (!$a?:print$x?",$a":$x=$a); instead of (!$a?:$t[]=$a);echo join(",",$t);

Javascript, 149 bytes
function a(n){o=Array.from(Array((n+1)).keys());o.shift();o.shift();for(i=1;i<o.length;i++){if(o[i]%o[0]==0){o.splice(i,1);o.shift();i=0;}}return o;}

Here's a working example. All the HTML and the wrapper() function is just so it's actually interactive.

<!DOCTYPE html>

<meta charset="UTF-8">
<title>Aloned</title>

Enter an integer:

<input type="text" id="i" value="5" />

<input type="button" value="Alone It!" onclick="wrapper()" />

This ungolfed code snippet has some comments and lets you interactively see the steps for any given input.

<!DOCTYPE html>

<meta charset="UTF-8">
<title>Aloned</title>

Enter an integer:

<input type="text" id="i" value="5" />

<input type="button" value="Alone It!" onclick="wrapper()" />

Racket 191 bytes
(let loop((fl(range 2(add1 n)))(fg #f))(define i(first fl))(for((j(rest fl))
#:when(= 0(modulo j i))#:final(= 0(modulo j i)))
(set! fl(remove*(list i j)fl))(set! fg #t))(if fg(loop fl #f)fl))

Ungolfed (comments after ';'):
(define (f n)
  (let loop ((fl (range 2 (add1 n)))  ; create a full list of numbers
             (fg #f))                 ; flag to show if main list is modified
    (define i (first fl))
    (for ((j (rest fl)) #:when (= 0 (modulo j i))  ; test divisibility
                        #:final (= 0 (modulo j i)))
      (set! fl (remove* (list i j) fl))  ; remove these from main list
      (set! fg #t))
    (if fg (loop fl #f)              ; if main list modified, check again,
        fl)))                         ; else print modified list.

Testing:
(f 2)
(f 6)
(f 15)
(f 20)
(f 22)

Output:
'(2)
'(5)
'(8 9 11 12 13 15)
'(11 12 13 15 17 19 20)
'(12 13 15 17 19 20 21)

JavaScript (ES6), 92 bytes
f=(n,R=[...Array(n-1)].map((_,i)=>i+2),[i,...r]=R)=>~r.indexOf(i*=2)?f(n,r.filter(x=>x-i)):R

I thought I had posted this yesterday, but obviously not...
Here's another version:
f=(n,R=[...Array(n-1)].map((_,i)=>i+2),[i,...r]=R,q=r.filter(x=>x-i*2))=>q+""!=r+""?f(n,q):R

Java 7, 210 bytes
import java.util.*;List c(int n){List<Integer>l=new ArrayList();int i=1;for(;i++<n;l.add(i));for(i=1;i++<n;)for(int x:l)if(i!=x&x%i<1&l.indexOf(i)>=0){l.remove((Integer)i);l.remove((Integer)x);break;}return l;}

Can definitely be golfed some more by using a different approach, probably by using an array with some tricks. Due to the cast, break, typed-list and if-checks it is a bit longer than expected, but it works.
Ungolfed & test code:
Try it here.
import java.util.*;
class M{
  static List c(int n){
    List<Integer> l = new ArrayList();
    int i = 1;
    for(; i++ < n; l.add(i));
    for(i = 1; i++ < n;){
      for(int x : l){
        if(i != x & x%i < 1 & l.indexOf(i) >= 0){
          l.remove((Integer)i);
          l.remove((Integer)x);
          break;
        }
      }
    }
    return l;
  }

  public static void main(String[] a){
    System.out.println(Arrays.toString(c(2).toArray()));
    System.out.println(Arrays.toString(c(6).toArray()));
    System.out.println(Arrays.toString(c(15).toArray()));
    System.out.println(Arrays.toString(c(20).toArray()));
    System.out.println(Arrays.toString(c(22).toArray()));
  }
}

Output:
[2]
[5]
[8, 9, 11, 12, 13, 15]
[11, 12, 13, 15, 17, 19, 20]
[12, 13, 15, 17, 19, 20, 21]