Codeforces Alpha Round 21 (Codeforces format)


A. Jabber ID
time limit per test: 0.5 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
[email protected]
Output
YES
Input
[email protected]
/contest.icpc/12
Output
NO
----------------------------------------------------------------------------------------------------
B. Intersection
time limit per test: 1 second
memory limit per test: 256 megabytes
input: standard input
output: standard output

Examples
Input
1 1 0
2 2 0
Output
-1
Input
1 1 0
2 -2 0
Output
1
----------------------------------------------------------------------------------------------------
C. Stripe 2
time limit per test: 1 second
memory limit per test: 64 megabytes
input: standard input
output: standard output

Examples
Input
4
1 2 3 3
Output
1
Input
5
1 2 3 4 5
Output
0
----------------------------------------------------------------------------------------------------
D. Traveling Graph
time limit per test: 0.5 second
memory limit per test: 64 megabytes
input: standard input
output: standard output

Examples
Input
3 3
1 2 1
2 3 1
3 1 1
Output
3
Input
3 2
1 2 3
2 3 4
Output
14
----------------------------------------------------------------------------------------------------
