That is the feeling of being in love

“In the novel, when they’re driving through the tunnel for the first time - the Lincoln Tunnel to go to New Jersey. The writer says: 'She - Therese - she wished the tunnel would collapse on top of the them killing them both so their bodies could be dragged out one after the next.' And it was just like, that is the feeling of being in love. You want time to stop right there and you want a kind of fatal melodramatic end, and to sort of reveal this coupling for the world to see. " - Todd Haynes

Escape Plan
Problem Description
Without turning his head, Vader snarled through his mask, ``The Millennium Falcon?"

Escape Plan
Description

Piett paused a moment before replying. He would have preferred to avoid that issue. ``Our tracking scanners are on it now," he responded a bit fearfully.

Without turning his head, Vader snarled through his mask, “The Millennium Falcon?”
Piett paused a moment before replying. He would have preferred to avoid that issue. “Our tracking scanners are on it now,” he responded a bit fearfully.
Vader turned to face the admiral, his towering figure looming over the frightened officer. Piett felt a chill course through his veins, and when the Dark Lord spoke again his voice conveyed an image of the dreadful fate that would be inflicted if his commands were not executed.
“I want that ship,” he hissed.
The ice planet was rapidly shrinking to a point of dim light as the Millennium Falcon sped into space. Soon that planet seemed nothing more than one of the billions of light specks scattered throughout the black void.
But the Falcon was not alone in its escape into deep space. Rather, it was followed by an Imperial fleet that included the Avenger Star Destroyer and a half-dozen TIE fighter. The fighters moved ahead of the huge, slower-moving Destroyer, and closed in on the fleeing Millennium Falcon.
— Star Wars, Episode V, the Empire Strikes Back
You are driving Millennium Falcon, the fastest starship of the entire galaxy, to escape Imperial pursuit. There are N planet systems, numbered from 0 to N − 1, and some of them are connected by one-way hyperspace tunnels. Some hyperspace tunnels are passable at all times, while others are only available at certain times. Initially you are at the ice planet Hoth, the system numbered 0, at time 0 and you need to get to Sullust, the system numbered N − 1. Since there are K Imperial Star Destroyers following you, and they will also make the jump into the hyperspace to continue the pursuit, you have decided to use the K + 1th shortest path from Hoth to Sullust so as to minimize the possibility of being attacked halfway by Imperial starships; furthermore, in order to avoid detection, you do not want to risk staying at a system longer than T seconds.

Vader turned to face the admiral, his towering figure looming over the frightened officer. Piett felt a chill course through his veins, and when the Dark Lord spoke again his voice conveyed an image of the dreadful fate that would be inflicted if his commands were not executed.

Note that multiple shortest paths may require same travel time, and your travel path may not be simple (i.e. you are allowed to visit some systems and use some hyperspace tunnels more than once during your journey).

``I want that ship," he hissed.

Input

365bet体育在线投注,The ice planet was rapidly shrinking to a point of dim light as the Millennium Falcon sped into space. Soon that planet seemed nothing more than one of the billions of light specks scattered throughout the black void.

There are multiple test cases in the input file. Each test case starts with four integers N, M, K and T, (1 ≤ N ≤ 100, 0 ≤ M ≤ 500, 0 ≤ K ≤ 9, 0 ≤ T ≤ 100), the number of planet systems, the number of hyperspace tunnels between them, the pursuing Imperial Star Destroyers, and the maximal allowed time to stay at the same system, respectively. M lines follow, each line describes one of the hyperspace tunnels: four integers U, V, C, and W, (0 ≤ U, V ≤ N − 1, 1 ≤ C ≤ 10, 1 ≤ W ≤ 1000000) meaning there’s a tunnel from U to V , traveling through this path requires W seconds and it is only available every C seconds, starting from time 0 (i.e. 0, C, 2 *365bet亚洲官方投注, C, 3 * C … seconds).

But the Falcon was not alone in its escape into deep space. Rather, it was followed by an Imperial fleet that included the Avenger Star Destroyer and a half-dozen TIE fighter. The fighters moved ahead of the huge, slower-moving Destroyer, and closed in on the fleeing Millennium Falcon.

Two successive inputs are separated by a blank line. N = 0, M = 0, K = 0, T = 0 indicates the end of input and should not be processed by your program.

-- Star Wars, Episode V, the Empire Strikes Back

Output

You are driving Millennium Falcon, the fastest starship of the entire galaxy, to escape Imperial pursuit. There are N planet systems, numbered from 0 to N - 1 , and some of them are connected by one-way hyperspace tunnels. Some hyperspace tunnels are passable at all times, while others are only available at certain times. Initially you are at the ice planet Hoth, the system numbered 0, at time 0 and you need to get to Sullust, the system numbered N - 1 . Since there are K Imperial Star Destroyers following you, and they will also make the jump into the hyperspace to continue the pursuit, you have decided to use the -th shortest path from Hoth to Sullust so as to minimize the possibility of being attacked halfway by Imperial starships; furthermore, in order to avoid detection, you do not want to risk staying at a system longer than T seconds.

For every test case, you should output one integer on a separate line, the total time we need to reach Sullust in the format as indicated in the sample output; output -1 if no such path can be found.

Note that multiple shortest paths may require same travel time, and your travel path may not be simple (i.e. you are allowed to visit some systems and use some hyperspace tunnels more than once during your journey).

Sample Input

Input
There are multiple test cases in the input file. Each test case starts with four integers N , M , K and T , (1<=N<=100, 0<=M<=500, 0<=K<=9, 0<=T<=100) , the number of planet systems, the number of hyperspace tunnels between them, the pursuing Imperial Star Destroyers, and the maximal allowed time to stay at the same system, respectively. M lines follow, each line describes one of the hyperspace tunnels: four integers U , V , C , and W , (0<=U, V<=N - 1, 1<=C<=10, 1<=W<=1000000) meaning there's a tunnel from U to V , traveling through this path requires W seconds and it is only available every C seconds, starting from time 0 (i.e. 0, C, 2 * C, 3 * C... seconds).

5 9 2 2
1 2 5 5
2 4 6 6
0 2 1 8
1 4 4 3
3 0 1 8
1 3 5 10
0 4 4 4
2 3 3 4
3 1 5 10

Two successive inputs are separated by a blank line. N = 0, M = 0, K = 0, T = 0 indicates the end of input and should not be processed by your program.

10 0 0 0

Output
or every test case, you should output one integer on a separate line, the total time we need to reach Sullust in the format as indicated in the sample output; output -1 if no such path can be found.

0 0 0 0
Sample Output

Explanation for Sample Input / Output

Case 1: 28
Case 2: -1

The 1st shortest path in this example is 0 --> 4 , with a total travel time of 4 seconds; the 2nd shortest path is 0 (Wait 2 seconds) --> 2 (Wait 2 seconds) -->4, with a total travel time of 18 seconds; the 3rd shortest path is 0 (Wait 2 seconds) --> 2 (Wait 2 seconds) --> 3 --> 0 --> 4, with a total travel time of 28 seconds.

Sample Input
5 9 2 2
1 2 5 5
2 4 6 6
0 2 1 8
1 4 4 3
3 0 1 8
1 3 5 10
0 4 4 4
2 3 3 4
3 1 5 10

10 0 0 0

0 0 0 0

Sample Output
Case 1: 28
Case 2: -1

本文由365bet体育在线投注发布于港台影视,转载请注明出处:That is the feeling of being in love

相关阅读