Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pt q, w, e;
- cin >> q >> w >> e;
- w = w - q;
- int a = w.x;
- int b = w.y;
- int k = e.x;
- int t = e.y;
- int x, y;
- if(k == 0 && t == 0) {
- if(a == 0 && b == 0) {
- return cout << "YES", 0;
- }
- else {
- return cout << "NO", 0;
- }
- }
- else if(k == 0) {
- if(a % t == 0 && b % t == 0) {
- return cout << "YES", 0;
- }
- return cout << "NO", 0;
- }
- else if(t == 0) {
- if(a % k == 0 && b % k == 0) {
- return cout << "YES", 0;
- }
- return cout << "NO", 0;
- }
- else {
- y = (k * b - t * a) / (k * k + t * t);
- x = (a + t * y) / k;
- }
- if(k * x + t * y == a && t * x - k * y == b) {
- cout << "YES";
- }
- else {
- cout << "NO";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement