Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- int main()
- {
- int casos, n;
- scanf("%d", &casos);
- for(int i=0; i<casos; i++)
- {
- scanf("%d", &n);
- if(n != 0 && n < 4)
- {
- printf("N\n");
- }
- else
- {
- double raiz = sqrt(n*(n-4));
- double a = (n+raiz)/2;
- double b = (n-raiz)/2;
- printf("Y %.10f %.10f\n", a, b);
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement