#include #include #include #include using namespace std; class cable { public: cable(int length) { this->length = length; criticalLength = length; pieces = 0; } int length; int pieces; int criticalLength; bool operator <(const cable& c) const { return criticalLength > c.criticalLength; } void breakCable() { pieces++; criticalLength = length / (pieces + 1); /*cout << "l=" << length << ", al=" << length/pieces << " cl=" << criticalLength << ", p=" << pieces << endl;*/ } int actualLength() { return length / pieces; } }; int parseLength(string length) { int l = length.length(); istringstream is(length.substr(0, l-3) + length.substr(l-2)); int t; is >> t; return t; } int doit(int cables, int pieces) { typedef multiset tq; tq queue; for (int i=0; i> length; queue.insert(cable(parseLength(length))); } int currentPieces = 0; while (true) { tq::iterator head = queue.begin(); cable c = *head; queue.erase(head); c.breakCable(); if (c.criticalLength == 0) return 0; currentPieces++; if (currentPieces == pieces) return c.actualLength(); queue.insert(c); } } string format(int number) { ostringstream s; s << number; string r = s.str(); while (r.length() < 3) r = "0" + r; int l = r.length(); return r.substr(0, l-2) + "." + r.substr(l-2); } int main() { int cables, pieces; while (1) { cin >> cables >> pieces; if (cables == 0 && pieces == 0) break; cout << format(doit(cables, pieces)) << endl; } return 0; }