题不难,分好各种情况后再写,一个分类讨论的问题没带优盘,保存一下![可怜](http://static.blog.csdn.net/xheditor/xheditor_emot/default/cute.gif)
![可怜](http://static.blog.csdn.net/xheditor/xheditor_emot/default/cute.gif)
#include<stdio.h> #include<math.h> int main() { int T, length, wide, radius, dia; scanf("%d", &T); while(T--) { scanf("%d%d%d", &length, &wide, &radius); dia = 2 * radius; if(dia <= wide) printf("impossible\n"); else { double len=sqrt((dia*dia - wide*wide)); if((len - length) > 0.0) printf("1\n"); else { if(len-1.0 < 0.00001) printf("impossible\n"); else { int num; double fnum; fnum = (double)length/len; num = ceil(fnum); printf("%d\n", num); } } } } return 0; }