#D518. Cost Performance Flow

    ID: 428 Type: Default 2000ms 268MiB

Cost Performance Flow

Cost Performance Flow

Example

Input

2 1 1 2 1 2 1 1

Output

1/2

inputFormat

Input

2 1 1 2 1 2 1 1

outputFormat

Output

1/2

样例

2 1
1 2
1 2 1 1
1/2