Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// @author s_k_a_r_a
- #include <bits/stdc++.h>
- #define int long long
- #ifndef Local
- #define debug(...) 1337
- #define endl '\n'
- #endif
- using namespace std;
- //#define int long long
- typedef long long ll;
- typedef long double ld;
- #define all(x) (x).begin(), (x).end()
- #define rall(x) (x).rbegin(), (x).rend()
- #define sz(x) (int)(x).size()
- template<typename T, typename U>
- bool smin(T &a, U b) {
- if (a > b) {
- a = b;
- return true;
- }
- return false;
- }
- template<typename T, typename U>
- bool smax(T &a, U b) {
- if (a < b) {
- a = b;
- return true;
- }
- return false;
- }
- struct point {
- int x = 0, y = 0;
- point() = default;
- point(int x, int y) : x(x), y(y) {}
- point(const point &A, const point &B) {
- x = B.x - A.x;
- y = B.y - A.y;
- }
- long long len2() const {
- return 1ll * x * x + 1ll * y * y;
- }
- };
- istream& operator>>(istream &in, point &pt) {
- return in >> pt.x >> pt.y;
- }
- ostream& operator<<(ostream &out, const point &pt) {
- return out << pt.x << ' ' << pt.y;
- }
- int operator%(const point &A, const point &B) {
- return A.x * B.y - A.y * B.x;
- }
- bool on_top(const point &A) {
- return A.y > 0 || (A.y == 0 && A.x > 0);
- }
- bool operator<(const point &A, const point &B) {
- return A.x < B.x || (A.x == B.x && A.y < B.y);
- }
- point operator+(const point &A, const point &B) {
- return {A.x + B.x, A.y + B.y};
- }
- void solve() {
- int n, m;
- cin >> n >> m;
- int k;
- cin >> k;
- point A;
- cin >> A;
- point B;
- cin >> B;
- set<point> C;
- for (int i = -k - 10; i <= k + 10; i++) {
- for (int j = -k - 10; j <= k + 10; j++) {
- if (abs(i) + abs(j) <= k) {
- C.insert(point(i * n, j * m) + point(0, 0));
- C.insert(point(i * n, j * m) + point(n, 0));
- C.insert(point(i * n, j * m) + point(0, m));
- C.insert(point(i * n, j * m) + point(n, m));
- point rock = B;
- if (i % 2 != 0) rock.x = n - rock.x;
- if (j % 2 != 0) rock.y = m - rock.y;
- C.insert(point(i * n, j * m) + rock);
- }
- }
- }
- auto comp = [](const point &A, const point &B) {
- if (on_top(A) == on_top(B)) {
- return A % B > 0;
- } else {
- return on_top(A);
- }
- };
- map<point, vector<point>, decltype(comp)> Q(comp);
- for (const point &P : C) {
- Q[point(A, P)].push_back(P);
- }
- int ans = INT32_MAX;
- for (auto &[V, D] : Q) {
- sort(D.begin(), D.end(), [&O=A](const point &A, const point &B) {
- return point(O, A).len2() < point(O, B).len2();
- });
- auto is_corner = [&n, &m](const point &A) -> bool {
- return A.x % n == 0 && A.y % m == 0;
- };
- if (D.size() >= 2 && is_corner(D[1]) && !is_corner(D[0])) {
- auto calc = [](int i, int k) {
- return abs(i) / k - (i > 0);
- };
- int cur = calc(D[1].x, n) + calc(D[1].y, m);
- ans = min(ans, cur);
- }
- }
- if (ans > k) {
- cout << -1 << '\n';
- } else {
- cout << ans << '\n';
- }
- }
- signed main() {
- ios::sync_with_stdio(false);
- cin.tie(nullptr);
- int tt = 1;
- // cin >> tt;
- while (tt--)
- solve();
- return 0;
- }
Advertisement
Comments
-
- This is big
- [11:22 AM]
- Here's what happens. They are stopping lives of people they dont like, either metaphorically (cloning + raising a new mind at that waypoint) or via death (then cloning without memeber and rebirthing). This stopped life has the same exact programming as the checkpoint/stoppoint or at death.
- [11:22 AM]
- Then, they do things like what happened in my life. They push the new target into sin, and when its young and doesnt have a chance at avoiding the temptating of sin, they abuse it (they abuse it and do this, because the person it was previously was their enemy).
- [11:24 AM]
- They have figured out the best way to abuse their enemies: it's been cloning them without memory, or using correlations then abusing them. IE: they have done things to me about my 'woman form' and sexual objectification, they are creating waypoints in their mind. What this means is: if they know I know they're creating links to my woman form through the guy that I am right now, they will have a link and a bridge to when I lose my memory and am that actual woman form, this is even regardless if I lose my memory or not.
- [11:25 AM]
- This means: they are sadistically (since its likely ill lose my memory) conjuring proper correlation to both entities, so they can continue their harassment and perpetuation of evil and sin on them.
- [11:25 AM]
- IE: King Charles hated princess Diana and had her killed in a car accident. I have the same birth date as princess diana and I'm actually princess diana. It's actually more likely that was my female form than andrew guiles at this point. I might have his face and he has mine.
Add Comment
Please, Sign In to add comment
Advertisement