fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. static void Main(string[] args)
  6. {
  7. int x = 1, y = 0;
  8. int K = Convert.ToInt32(Console.ReadLine());
  9. for(;;)
  10. {
  11. x += 2 * y;
  12. y = 5 * y - 2 * x;
  13. if (x > K || y > K) break;
  14. }
  15. Console.WriteLine("x = " + x + " y = " + y);
  16. }
  17.  
  18. }
Success #stdin #stdout 0.02s 26756KB
stdin
100
stdout
x = 117  y = -44