CF1220E Tourism
Description
Alex decided to go on a touristic trip over the country.
For simplicity let's assume that the country has $ n $ cities and $ m $ bidirectional roads connecting them. Alex lives in city $ s $ and initially located in it. To compare different cities Alex assigned each city a score $ w_i $ which is as high as interesting city seems to Alex.
Alex believes that his trip will be interesting only if he will not use any road twice in a row. That is if Alex came to city $ v $ from city $ u $ , he may choose as the next city in the trip any city connected with $ v $ by the road, except for the city $ u $ .
Your task is to help Alex plan his city in a way that maximizes total score over all cities he visited. Note that for each city its score is counted at most once, even if Alex been there several times during his trip.
Input Format
N/A
Output Format
N/A