You might have heard the game of 24: given 4 integers, you're to make an expression to get the number 24. For example, given 4, 4, 10, 10, you can write (10*10-4)/4=24, given 1, 5, 5, 5, you can write (5-1/5)*5=24.
In this problem, your task is a little bit harder: count the number of numbers that can be made. Don't forget to count negative numbers and non-integers. You can use binary additions, subtractions, multiplications and divisions with parenthesis (unary operations are not allowed). Numbers cannot be concatenated to form a larger number (e.g. you cannot concatenate 1 and 2 to get 12).
For example, given two 1's, exactly 3 numbers can be made: 1+1=2, 1-1=0, 1*1=1. You cannot get 11 or -1.
2 1 1 3 1 4 7 4 1 2 3 5 0
Case 1: 3 Case 2: 47 Case 3: 255