Created the problem in C. The only problem is it doesn't take input from terminal.