yet education system reform carry Berland recently the innovation followsan academic year consist n day each day pupil study exactly m subject subject study day after lesson ith subject pupil home task contain ai bi exercise besides subject special attribute complexity ci a school timetable consider follow condition satisfied timetable contain subject order complexity strict increase day task contain k times exercise k compare previous day formally let number home task exercise ith day xi 1 in xikxi1 xikxi1 true total number exercise home task maximal possible all limitation separately set schoolIt turn case ai bi reach 1016 Berland Minister Education famous love halfmeasure value biai do not exceed 100 that happen Berland School 256 nevertheless school principal work timetable academic year