pseudocode for ex. 1
init sol for ex. 1