P3003 [USACO10DEC] Apple Delivery S

Description

Bessie has two crisp red apples to deliver to two of her friends in the herd. Of course, she travels the C (1

Input Format

\* Line 1: Line 1 contains five space-separated integers: C, P, PB, PA1, and PA2 \* Lines 2..C+1: Line i+1 describes cowpath i by naming two pastures it connects and the distance between them: P1\_i, P2\_i, D\_i

Output Format

\* Line 1: The shortest distance Bessie must travel to deliver both apples