fork(5) download
  1. #include <iostream>
  2. #include <math.h>
  3. #include <iomanip>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. int testy;
  10. cin>>testy;
  11. for (int i=0; i<testy; i++)
  12. {
  13. unsigned long osoby,ciec;
  14. long double srednica,cm;
  15. cin>>srednica>>osoby;
  16. cm=(((srednica*M_PI)/osoby));
  17. if (osoby%2==0)
  18. {
  19. ciec=(osoby/2);
  20. cout<<fixed<<setprecision(3)<<cm<<" "<<ciec<<endl;
  21. }
  22. else
  23. {
  24. ciec=osoby;
  25. cout<<fixed<<setprecision(3)<<cm<<" "<<ciec<<endl;
  26. }
  27. }
  28. return 0;
  29. }
  30.  
  31.  
Success #stdin #stdout 0s 15232KB
stdin
3
20 4
10 2
15 3
stdout
15.708 2
15.708 1
15.708 3