Created
May 5, 2018 09:36
-
-
Save MohamedTaha98/35dd68a919af29573dbcb3934ddd74ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cmath> | |
using namespace std; | |
int main() | |
{ | |
long L, S1, S2, Q; | |
cin >> L >> S1 >> S2; | |
cin >> Q; | |
for (int i = 0; i < Q; i++) | |
{ | |
int q; | |
cin >> q; | |
double side = sqrt(q); | |
cout << sqrt(2 * pow(L - side, 2)) / abs(S1 - S2) << endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment