Problem:


Score : 500 points

Problem Statement

There is a directed graph with N vertices numbered 1 to N and M edges.
The i-th edge is directed from Vertex A_i to Vertex B_i, and there are C_i coins placed along that edge.
Additionally, there is a button on Vertex N.

We will play a game on this graph.
You start the game on Vertex 1 with zero coins, and head for Vertex N by traversing the edges while collecting coins.
It takes one minute to traverse an edge, and you can collect the coins placed along the edge each time you traverse it.
As usual in games, even if you traverse an edge once and collect the coins, the same number of coins will reappear next time you traverse that edge, which you can collect again.

When you reach Vertex N, you can end the game by pressing the button. (You can also choose to leave Vertex N without pressing the button and continue traveling.)
However, when you end the game, you will be asked to pay T \times P coins, where T is the number of minutes elapsed since the start of the game. If you have less than T \times P coins, you will have to pay all of your coins instead.

Your score will be the number of coins you have after this payment.
Determine if there exists a maximum value of the score that can be obtained. If the answer is yes, find that maximum value.

Constraints

2 \leq N \leq 2500

1 \leq M \leq 5000

1 \leq A_i, B_i \leq N

1 \leq C_i \leq 10^5

0 \leq P \leq 10^5

All values in input are integers.

Vertex N can be reached from Vertex 1.

Input

Input is given from Standard Input in the following format:

N M P
A_1 B_1 C_1
:
A_M B_M C_M

Output

If there exists a maximum value of the score that can be obtained, print that maximum value; otherwise, print -1.

Sample Input 1

3 3 10
1 2 20
2 3 30
1 3 45

Sample Output 1

35

There are two ways to travel from Vertex 1 to Vertex 3:

Vertex 1 \rightarrow 2 \rightarrow 3: You collect 20 + 30 = 50 coins on the way. After two minutes from the start of the game, you press the button, pay 2 \times 10 = 20 coins, and you have 50 - 20 = 30 coins left.

Vertex 1 \rightarrow 2: You collect 45 coins on the way. After one minute from the start of the game, you press the button, pay 1 \times 10 = 10 coins, and you have 45 - 10 = 35 coins left.

Thus, the maximum score that can be obtained is 35.

Sample Input 2

2 2 10
1 2 100
2 2 100

Sample Output 2

-1

The edge extending from Vertex 1 takes you to Vertex 2. If you then traverse the edge extending from Vertex 2 to itself t times and press the button, your score will be 90 + 90t. Thus, you can infinitely increase your score, which means there is no maximum value of the score that can be obtained.

Sample Input 3

4 5 10
1 2 1
1 4 1
3 4 1
2 2 100
3 3 100

Sample Output 3

0

There is no way to travel from Vertex 1 to Vertex 4 other than traversing the edge leading from Vertex 1 to Vertex 4 directly. You will pick up one coin along this edge, but after being asked to paying 10 coins, your score will be 0.

Note that you can collect an infinite number of coins if you traverse the edge leading from Vertex 1 to Vertex 2, but this is pointless since you can no longer reach Vertex 4 and end the game.



Sample input:
3 3 10
1 2 20
2 3 30
1 3 45


Sample output:
35

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10000000)
def input():
    return sys.stdin.readline()[:-1]
from bisect import *
from collections import *
from heapq import *
from math import *
from itertools import *
INF = float('inf')

def bellmanford(edges, s, t, se):
    N = len(edges)
    dist = [INF] * N
    dist[s] = 0
    for i in range(N-1):
        update = False
        for v in range(N):
            if v in se and dist[v] == INF:
                continue
            for u, c in edges[v]:
                if u not in se:
                    continue
                d = dist[v] + c
                if d < dist[u]:
                    dist[u] = d
                    update = True
        if update == False:
            return max(0, -dist[t])
    else:
        return -1


N, M, P = map(int, input().split())
es = [[] for i in range(N)]
es_r = [[] for i in range(N)]
for i in range(M):
    a, b, c = map(int, input().split())
    es[a-1].append((b-1, P-c))
    es_r[b-1].append(a-1)
reachable1 = [False] * N
def dfs(v):
    if reachable1[v]: return
    reachable1[v] = True
    for u, c in es[v]:
        dfs(u)
reachable2 = [False] * N
def rdfs(v):
    if reachable2[v]: return
    reachable2[v] = True
    for u in es_r[v]:
        rdfs(u)
dfs(0)
rdfs(N-1)
se = set()
for i in range(N):
    if reachable1[i] and reachable2[i]:
        se.add(i)
print(bellmanford(es, 0, N-1, se))

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10000000)
def input():
    return sys.stdin.readline()[:-1]
from bisect import *
from collections import *
from heapq import *
from math import *
from itertools import *
INF = float('inf')

def bellmanford(edges, s, t):
    N = len(edges)
    dist = [INF] * N
    dist[s] = 0
    for i in range(2*N):
        update = False
        for v in range(N):
            if dist[v] == INF:
                continue
            for u, c in edges[v]:
                d = dist[v] + c
                if d < dist[u]:
                    dist[u] = d
                    update = True
                    if u == t and N < i:
                        return -1
        if update == False:
            break
    return max(0, -dist[t])

N, M, P = map(int, input().split())
es = [[] for i in range(N)]
for i in range(M):
    a, b, c = map(int, input().split())
    es[a-1].append((b-1, P-c))
print(bellmanford(es, 0, N-1))

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10000000)
def input():
    return sys.stdin.readline()[:-1]
from bisect import *
from collections import *
from heapq import *
from math import *
from itertools import *
INF = float('inf')

def bellmanford(edges, s, t):
    N = len(edges)
    dist = [INF] * N
    dist[s] = 0
    for i in range(2*N):
        update = False
        for v in range(N):
            if dist[v] == INF: continue
            for u, c in edges[v]:
                d = dist[v] + c
                if d < dist[u]:
                    dist[u] = d
                    update = True
                    if u == t and N <= i:
                        return -1
        if update == False:
            break
    return max(0, -dist[t])

N, M, P = map(int, input().split())
es = [[] for i in range(N)]
for i in range(M):
    a, b, c = map(int, input().split())
    es[a-1].append((b-1, P-c))
print(bellmanford(es, 0, N-1))

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10000000)
def input():
    return sys.stdin.readline()[:-1]
from bisect import *
from collections import *
from heapq import *
from math import *
from itertools import *
INF = float('inf')

def bellmanford(edges, s, t):
    N = len(edges)
    dist = [INF] * N
    dist[s] = 0
    loopCnt = 0
    for i in range(2*N):
        update = False
        for v in range(N):
            if dist[v] == INF: continue
            for u, c in edges[v]:
                d = dist[v] + c
                if d < dist[u]:
                    dist[u] = d
                    update = True
                    if u == t and N <= loopCnt:
                        return -1
        if not update: break
        loopCnt += 1
    return max(0, -dist[t])

N, M, P = map(int, input().split())
es = [[] for i in range(N+1)]
for i in range(M):
    a, b, c = map(int, input().split())
    es[a].append((b, P-c))
print(bellmanford(es, 1, N))

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(10000000)
def input():
    return sys.stdin.readline()[:-1]
from bisect import *
from collections import *
from heapq import *
from math import *
from itertools import *
INF = float('inf')

def bellmanford(edges, s, t):
    N = len(edges)
    dist = [INF] * N
    dist[s] = 0
    loopCnt = 0
    while True:
        update = False
        for v in range(N):
            if dist[v] == INF: continue
            for u, c in edges[v]:
                d = dist[v] + c
                if d < dist[u]:
                    dist[u] = d
                    update = True
        if not update: break
        if loopCnt == N:
            update = False
            for v in range(N):
                if dist[v] == INF: continue
                for u, c in edges[v]:
                    d = dist[v] + c
                    if d < dist[u]:
                        dist[u] = d
                        if u == t:
                            update = True
            if update:
                return -1
            else:
                return max(0, -dist[t])
        loopCnt += 1
    return -dist[t]

N, M, P = map(int, input().split())
es = [[] for i in range(N+1)]
for i in range(M):
    a, b, c = map(int, input().split())
    es[a].append((b, P-c))
print(bellmanford(es, 1, N))

Submission status: Wrong Answer

Solution code:
import sys

sys.setrecursionlimit(10000)

n, m, p = list(map(int, input().split()))
abc = [list(map(int, input().split())) for _ in range(m)]
al = [[] for _ in range(n)]

for i in range(m):
    abc[i][0] -= 1
    abc[i][1] -= 1
    abc[i][2] = -(abc[i][2] - p)

for a, b, c in abc:
    al[a].append(b)

d = [1e9] * n
d[0] = 0

for _ in range(n - 1):
    for u, v, c in abc:
        if d[v] > d[u] + c:
            d[v] = d[u] + c

res = -d[-1]

for _ in range(n - 1):
    for u, v, c in abc:
        if d[v] > d[u] + c:
            d[v] = d[u] + c
    

if res != -d[-1]:
    print(-1)
else:
    print(max(res, 0))

Submission status: Wrong Answer

Solution code:
import sys

n, m, p = map(int, input().split())
routes =[]

for i in range(m):
    a, b, c = map(int, sys.stdin.readline().split())
    routes.append([a, b, -1 * (c - p)])

inf = float('inf')
costs = [inf for _ in range(n+1)]
costs[1] = 0
error = False
for i in range(n):
    for route in routes:
        if costs[route[0]] + route[2] < costs[route[1]]:
            costs[route[1]] = costs[route[0]] + route[2]
            if i == n-1 and route[1] == n:
                error = True
                break
if error == True:
    print(-1)
else:
    if costs[n] > 0:
        costs[n] = 0
    print(-1 * costs[n])

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(1000000000)
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())

def main():
    N, M, P = mis()
    
    to = [[] for _ in range(N)]
    ot = [[] for _ in range(N)]
    edges = []

    for i in range(M):
        a,b,c = mis()
        a -= 1
        b -= 1
        c = -(c-P)
        #
        to[a].append(b)
        ot[b].append(a)
        edges.append((a,b,c))

    reachableFrom0 = set()
    reachableToN = set()

    # dfs
    reachableFrom0.add(0)
    nodes = [0]
    while nodes:
        node = nodes.pop()
        for i in to[node]:
            if i not in reachableFrom0:
                nodes.append(i)
                reachableFrom0.add(i)

    #rdfs
    reachableToN.add(N-1)
    nodes = [N-1]
    while nodes:
        node = nodes.pop()
        for i in ot[node]:
            if i not in reachableToN:
                nodes.append(i)
                reachableToN.add(i)


    ok = reachableFrom0 & reachableToN

    edges = ((a, b, c) for a, b, c in edges if a in ok and b in ok)

    V = [float('inf')] * N
    V[0] = 0

    def bf(n):
        for _ in range(n):
            for a, b, c in edges:
                V[b] = min(V[b], V[a] + c)

    bf(N)

    Vb = tuple(V)
    bf(1)

    if tuple(V) == Vb:
        print(max(-V[-1], 0))
    else:
        print(-1)

main()

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(1000000000)

ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())

N, M, P = mis()

to = [[] for _ in range(N)]
ot = [[] for _ in range(N)]
edges = []

for i in range(M):
    a,b,c = mis()
    a -= 1
    b -= 1
    c = -(c-P)
    #
    to[a].append(b)
    ot[b].append(a)
    edges.append((a,b,c))

reachableFrom0 = [False] * N
reachableToN = [False] * N

def dfs(n):
    reachableFrom0[0] = True
    nodes = [n]
    while nodes:
        node = nodes.pop()
        for i in to[n]:
            if not reachableFrom0[i]:
                nodes.append(i)
                reachableFrom0[i] = True


def rdfs(n):
    reachableToN[-1] = True
    nodes = [n]
    while nodes:
        node = nodes.pop()
        for i in ot[n]:
            if not reachableToN[i]:
                nodes.append(i)
                reachableToN[i] = True

dfs(0)
rdfs(N-1)

ok = [a and b for a, b in zip(reachableFrom0, reachableToN)]

edges = [(a, b, c) for a, b, c in edges if ok[a] and ok[b]]

V = [float('inf')] * N
V[0] = 0

def bf_step():
    for a, b, c in edges:
        V[b] = min(V[b], V[a] + c)

def bf():
    for _ in range(N):
        bf_step()

bf()

Vb = tuple(V)
bf_step()

if tuple(V) == Vb:
    print(max(-V[-1], 0))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(1000000000)

ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())

N, M, P = mis()

to = [[] for _ in range(N)]
ot = [[] for _ in range(N)]
edges = []

for i in range(M):
    a,b,c = mis()
    a -= 1
    b -= 1
    c = -(c-P)
    #
    to[a].append(b)
    ot[b].append(a)
    edges.append((a,b,c))

reachableFrom0 = [False] * N
reachableToN = [False] * N

def dfs(n):
    reachableFrom0[0] = True
    nodes = [n]
    while nodes:
        node = nodes.pop()
        for i in to[n]:
            if not reachableFrom0[i]:
                nodes.append(i)
                reachableFrom0[i] = True


def rdfs(n):
    reachableToN[0] = True
    nodes = [n]
    while nodes:
        node = nodes.pop()
        for i in ot[n]:
            if not reachableToN[i]:
                nodes.append(i)
                reachableToN[i] = True

dfs(0)
rdfs(N-1)

ok = [a and b for a, b in zip(reachableFrom0, reachableToN)]

edges = [(a, b, c) for a, b, c in edges if ok[a] and ok[b]]

V = [float('inf')] * N
V[0] = 0

def bf_step():
    for a, b, c in edges:
        V[b] = min(V[b], V[a] + c)

def bf():
    for _ in range(N):
        bf_step()

bf()

Vb = tuple(V)
bf_step()

if tuple(V) == Vb:
    print(max(-V[-1], 0))
else:
    print(-1)

Submission status: Wrong Answer

Solution code:

import sys
def input():
	return sys.stdin.readline().strip()


N, M, P = list(map(int, input().split()))

score = [-10000000000 for i in range(N)]
root = [0 for i in range(N)]
root[0] = 1
score[0] = 0
edge_list = []
for i in range(M):
	A, B, C = list(map(int, input().split()))
	edge_list.append([A - 1, B - 1, C - P])

for i in range(N + 1):
	for edge in edge_list:
		if root[edge[0]] == 1:
			score[edge[1]] = max(score[edge[0]] + edge[2], score[edge[1]])
			root[edge[1]] = max(root[edge[0]], root[edge[1]])

x = score[N - 1]
for i in range(N):
	for edge in edge_list:
		if root[edge[0]] == 1:
			score[edge[1]] = max(score[edge[0]] + edge[2], score[edge[1]])
	if x < score[N - 1]:
		print(-1)
		exit()


print(max(0, score[N - 1]))

Submission status: Wrong Answer

Solution code:
import functools
from heapq import*
from collections import deque
import collections
import math
from collections import defaultdict
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
MOD = 10 ** 9 + 7
inf = float("inf")


def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors


def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


def is_prime(n):
    if n == 1:
        return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True


def primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return [i for i in range(n + 1) if is_prime[i]]


def modpow(a, n, mod):
    res = 1
    while n > 0:
        if n & 1:
            res = res * a % mod
        a = a * a % mod
        n >>= 1
    return res


def modinv(a, mod):
    return modpow(a, mod - 2, mod)


def cnk(a, b):
    MOD = 10**9+7
    ret = 1
    for i in range(b):
        ret *= (a-i)
        ret %= MOD
        ret = ret * modinv(i+1, MOD) % MOD
    return ret


def Dijkstra(n, start, e):
    # input parm e
    # e = [[]for i in range(n)]
    # e[x].append([y, 1])
    # e[y].append([x, 1])
    n += 10

    d = [float("inf") for i in range(n)]
    d[start] = 0

    pathnum = [0 for i in range(n)]
    pathnum[start] = 1

    visited = [False for i in range(n)]
    q = []
    heappush(q, (0, start))
    while len(q):
        now_distance, v = heappop(q)
        if visited[v]:
            continue
        visited[v] = True
        for next_v, next_distance in e[v]:
            if visited[next_v]:
                continue
            dd = now_distance + next_distance
            if d[next_v] > dd:
                d[next_v] = dd
                heappush(q, (dd, next_v))
            if d[next_v] == dd:
                pathnum[next_v] += pathnum[v]
                pathnum[next_v] %= MOD

    return d, pathnum


def warshall_floyd(d):
    for k in range(n):
        for i in range(n):
            for j in range(n):
                d[i][j] = min(d[i][j], d[i][k] + d[k][j])
    return d


class UnionFind:
    def __init__(self, n):
        self.sz = [-1 for i in range(n)]

    # 検索
    def find(self, x):
        if self.sz[x] < 0:
            return x
        else:
            self.sz[x] = self.find(self.sz[x])
            return self.sz[x]

    # 併合

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return False
        if self.sz[x] > self.sz[y]:
            x, y = y, x
        self.sz[x] += self.sz[y]
        self.sz[y] = x

    # 同じ集合に属するか判定
    def same(self, x, y):
        return self.find(x) == self.find(y)

    # xが含まれている集合のサイズを求める
    def size(self, x):
        return -self.sz[self.find(x)]


class WeightedUnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n+1)]
        self.rank = [0] * (n+1)
        # 根への距離を管理
        self.weight = [0] * (n+1)

    # 検索
    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            y = self.find(self.par[x])
            # 親への重みを追加しながら根まで走査
            self.weight[x] += self.weight[self.par[x]]
            self.par[x] = y
            return y

    # 併合
    def union(self, x, y, w):
        rx = self.find(x)
        ry = self.find(y)
        # xの木の高さ < yの木の高さ
        if self.rank[rx] < self.rank[ry]:
            self.par[rx] = ry
            self.weight[rx] = w - self.weight[x] + self.weight[y]
        # xの木の高さ ≧ yの木の高さ
        else:
            self.par[ry] = rx
            self.weight[ry] = -w - self.weight[y] + self.weight[x]
            # 木の高さが同じだった場合の処理
            if self.rank[rx] == self.rank[ry]:
                self.rank[rx] += 1

    # 同じ集合に属するか
    def same(self, x, y):
        return self.find(x) == self.find(y)

    # xからyへのコスト
    def diff(self, x, y):
        return self.weight[x] - self.weight[y]

#
# kruskal
#


@functools.lru_cache(maxsize=None)
class UNION_FIND(object):
    def __init__(self, n):
        self.parent = [-1 for i in range(n)]

    def root(self, x):
        if self.parent[x] < 0:
            return x
        else:
            self.parent[x] = self.root(self.parent[x])
            return self.parent[x]

    def size(self, x):
        return -self.parent[self.root(x)]

    def union(self, x, y):
        x = self.root(x)
        y = self.root(y)
        if x == y:
            return False
        if self.size(x) < self.size(y):
            x, y = y, x
        self.parent[x] += self.parent[y]
        self.parent[y] = x
        return True


def compute_mst_kruskal(max_v, edges):
    edges.sort(key=lambda x: x[2], reverse=1)
    uf = UNION_FIND(max_v)
    mst = []
    for (a, b, c, d) in edges:
        if uf.root(a-1) != uf.root(b-1):
            uf.union(a-1, b-1)
            mst += [d+1]
    return mst


# max_v, max_e = map(int, input().split())
# edges = []
# for i in range(max_e):
#     a, b, c = map(int, input().split())
#     heappush(edges, (a, b, c, i))

# mst = compute_mst_kruskal(max_v, edges)
# mst.sort()
# for i in mst:
#   print(i)

#
# Dinic
#

class Dinic:
    def __init__(self, N):
        self.N = N
        self.G = [[] for i in range(N)]

    def add_edge(self, fr, to, cap):
        forward = [to, cap, None]
        forward[2] = backward = [fr, 0, forward]
        self.G[fr].append(forward)
        self.G[to].append(backward)

    def add_multi_edge(self, v1, v2, cap1, cap2):
        edge1 = [v2, cap1, None]
        edge1[2] = edge2 = [v1, cap2, edge1]
        self.G[v1].append(edge1)
        self.G[v2].append(edge2)

    def bfs(self, s, t):
        self.level = level = [None]*self.N
        deq = deque([s])
        level[s] = 0
        G = self.G
        while deq:
            v = deq.popleft()
            lv = level[v] + 1
            for w, cap, _ in G[v]:
                if cap and level[w] is None:
                    level[w] = lv
                    deq.append(w)
        return level[t] is not None

    def dfs(self, v, t, f):
        if v == t:
            return f
        level = self.level
        for e in self.it[v]:
            w, cap, rev = e
            if cap and level[v] < level[w]:
                d = self.dfs(w, t, min(f, cap))
                if d:
                    e[1] -= d
                    rev[1] += d
                    return d
        return 0

    def flow(self, s, t):
        flow = 0
        INF = 10**9 + 7
        G = self.G
        while self.bfs(s, t):
            *self.it, = map(iter, self.G)
            f = INF
            while f:
                f = self.dfs(s, t, INF)
                flow += f
        return flow

# V, E, r = map(int, input().split())
# edges = []
# for i in range(E):
#     s, t, d = map(int, input().split())
#     edges.append([s, t, d])

# d = BellmanFord(edges, V, r)
# if d == -1:
#     print("NEGATIVE CYCLE")
#     exit()

# for i in range(V):
#     if d[i] == float("inf"):
#         print("INF")
#     else:
#         print(d[i])


# def BellmanFord(edges, n, s):
#     # グラフの初期化
#     dist = [float("inf") for i in range(n)]
#     dist[s] = 0

#     # 辺の緩和
#     for i in range(n):
#         for edge in edges:
#             if edge[0] != float("inf") and dist[edge[1]] > dist[edge[0]] + edge[2]:
#                 dist[edge[1]] = dist[edge[0]] + edge[2]
#                 if i == n-1 and edge[1] == n - 1:
#                     return -1

#     return dist


def Bellmanford(edges, n, s):
    d = [float("inf") for i in range(n)]
    d[s] = 0
    # while True:
    #update = False
    for i in range(n):
        for x, y, z in edges:
            if d[y] > d[x] + z:
                d[y] = d[x] + z
    d1 = d[n - 1]
    for i in range(n):
        for x, y, z in edges:
            if d[y] > d[x] + z:
                d[y] = d[x] + z

    if d1 != d[n - 1]:
        print(-1)
    else:
        return print(max(0, -d[n - 1]))

        #             update = True
        #             if i == n - 1:
        #                 return -1
        # if not update:
        #     break
    # return d


def main():
    n, m, p = map(int, input().split())

    #e = [[]for i in range(n)]
    e = []
    for i in range(m):
        a, b, c = map(int, input().split())
        e.append((a-1, b-1, p-c))
        #e[a - 1].append((b-1, -(c - p)))

    d = Bellmanford(e, n, 0)
    # if d == False:
    #     print(-1)
    #     exit()

    # if -d <= 0:
    #     print(0)
    # else:
    #     print(-d)


if __name__ == '__main__':
    main()