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