only t millisecond leave start wellknown online programming contest Codehorses Round 2017polycarp need download b compiler contest the size file f bytesPolycarps internet tariff allow download datum rate byte t0 millisecond this tariff prepay use incur expense Polycarp in addition internet service provider offer additional package download a1 byte rate byte t1 millisecond pay p1 burle package download a2 byte rate byte t2 millisecond pay p2 burle package Polycarp buy package time when buy package price p1 p2 prepaid usage once package buy replace regular tariff package datum limit completely after package consume Polycarp immediately buy new package switch regular tariff loose time while package use Polycarp can not buy package switch regular internet tarifffind minimum money Polycarp spend download f bytes file T millisecondsnote technical reason Polycarp download integer number byte regular tariff package ie download mode number download byte integer it mean Polycarp can not download byte partially regular tariff orand package