1516 solved, 1517 with unclear runtime error
Add Solution to 1518
Add solution to 1519
Add Solution to the 0 problem of contest 1047
note, the solution cannot be submitted if out of the time range