摘要:
题意:给你n根线,现在要把这n根线切割成k根等长(设长为len)的线,问能切得的最长的len为多少,结果保留两位小数。#include <iostream>#define Max 10005using namespace std;double tlen[Max];int calc(double x,int n)//计算当以x长切割时,能切割成多少根线{int sum=0;for(int i=0;i<n;i++){sum+=int(tlen[i]/x);}return sum;}int main(){int n,k;doublemx,mid,sum,ans;while(cin& 阅读全文