modify the data structure of 'constraint' and the function of 'readInput'
to check range of X-axis whether it is feasible
add a comment
make the comments which talk about the procedures