<commit_before>#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>

#define INF 0x3f3f3f3f
#define MAX 30

using namespace std;

int w, h, g, e;
int dist[MAX][MAX], r[MAX][MAX], vis[MAX][MAX][MAX][MAX];
vector< pair< pair<int, int> , int> > adj[MAX][MAX];

int bellman_ford(int x, int y, int dx, int dy) {
    int vc = w*h;
    
    memset(dist, 0x3f, sizeof(dist));   
    dist[x][y] = 0;
    
    for (int a = 1; a < vc; a++) {
        for (int i = 0; i < w; i++) {
            for (int j = 0; j < h; j++) {
                if (i == dx && j == dy) continue;
                for (int k = 0; k < adj[i][j].size(); k++) {
                    if (dist[i][j] != INF && dist[i][j] + adj[i][j][k].second < dist[adj[i][j][k].first.first][adj[i][j][k].first.second]) {
                        dist[adj[i][j][k].first.first][adj[i][j][k].first.second] = dist[i][j] + adj[i][j][k].second;
                    }
                }
            }
        }
    }
    
    for (int i = 0; i < w; i++) {
        for (int j = 0; j < h; j++) {
            if (i == dx && j == dy) continue;
            for (int k = 0; k < adj[i][j].size(); k++) {
                if (dist[i][j] != INF && dist[i][j] + adj[i][j][k].second < dist[adj[i][j][k].first.first][adj[i][j][k].first.second]) {
                    return -1;
                }
            }
        }
    }
}

int main() {
    int x, y, _x, _y, t, ans;
    scanf("%d %d", &w, &h);
    while (w && h) {
        memset(r, 0, sizeof(r));
        for (int i = 0; i < MAX; i++) {
            for (int j = 0; j < MAX; j++) {
                adj[i][j].clear();
            }
        }
        <commit_msg>Update graveyard.cpp to work with spoj<commit_after>#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>

#define INF 0x3f3f3f3f
#define MAX 30

using namespace std;

int w, h, g, e;
int dist[MAX][MAX], r[MAX][MAX], vis[MAX][MAX][MAX][MAX];
vector< pair< pair<int, int> , int> > adj[MAX][MAX];

int bellman_ford(int x, int y, int dx, int dy) {
    int vc = w*h;
    
    memset(dist, 0x3f, sizeof(dist));   
    dist[x][y] = 0;
    
    for (int a = 1; a < vc; a++) {
        for (int i = 0; i < w; i++) {
            for (int j = 0; j < h; j++) {
                if (i == dx && j == dy) continue;
                for (int k = 0; k < adj[i][j].size(); k++) {
                    if (dist[i][j] != INF && dist[i][j] + adj[i][j][k].second < dist[adj[i][j][k].first.first][adj[i][j][k].first.second]) {
                        dist[adj[i][j][k].first.first][adj[i][j][k].first.second] = dist[i][j] + adj[i][j][k].second;
                    }
                }
            }
        }
    }
    
    for (int i = 0; i < w; i++) {
        for (int j = 0; j < h; j++) {
            if (i == dx && j == dy) return 0; // the moment he reaches it he exits
            for (int k = 0; k < adj[i][j].size(); k++) {
                if (dist[i][j] != INF && dist[i][j] + adj[i][j][k].second < dist[adj[i][j][k].first.first][adj[i][j][k].first.second]) {
                    return -1;
                }
            }
        }
    }
}

int main() {
    int x, y, _x, _y, t, ans;
    scanf("%d %d", &w, &h);
    while (w && h) {
        memset(r, 0, sizeof(r));
        for (int i = 0; i < MAX; i++) {
            for (int j = 0; j < MAX; j++) {
                adj[i][j].clear();
            }
        }
        
{'fraction_non_alphanumeric': 0.21712085308056872, 'fraction_numerical': 0.01273696682464455, 'mean_word_length': 1.617829457364341, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5737579', 'n_tokens_mistral': 1355, 'n_tokens_neox': 1301, 'n_words': 335}