Blazing goIITian
The second question has the answer in the following link ..
http://www.goiit.com/posts/list/trignometry-sot-challenge-46259.htm#228738