Use the cosine rule.
You could use pascal's triangle and find out what it is, looking at the first or last 6 numbers in the 13th row, including the ones at the top, add them together, and substract that from 2^12
For a, you can find that you have to choose 2 from each row, making (4 choose 2)^4, which is 1296
For b, it is the same, except it is 4 choose 3, making it 4^4=256 if i am not mistaken
I would suggest doubling the angle of 45 degrees so that you can apply the Pythagorean Thereom