Solutions for ZOJ problems