• Source
    1. #include <iostream>
    2. using namespace std;
    3.  
    4. int main ()
    5. {
    6. int n, k;
    7. cin>>n>>k;
    8. if (k%(n-1)==0)
    9. {
    10. int th1 = (k/(n-1))*n;
    11. int th2 = k+(k/(n-1))-1;
    12. if (th1<th2) cout<<th1<<" "<<th2;
    13. else cout<<th2<<" "<<th1;
    14. }
    15. else
    16. {
    17. int Teo=(k/(n-1));
    18. cout<<Teo+k<<" "<<Teo+k;
    19. }
    20. return 0;
    21. }