TouchStone
  Please Login
Login Sign Up
 Homepage  Problem Set  Examinations  Submissions  Discussions  Statistics
  • Home
  • Problem Set
  • P4692
  • Problem
  • P4692「清华集训 2017」某位歌姬的故事
    Limits : Time Limit : - MS   Memory Limit : - KB
    Judgment Tips : 1s 512m
    Description

    Input Format

    Output Format

    Sample Input 1

    1
    3 2 3
    1 2 3
    2 3 2

    Sample Output 1

    3

    Sample Input 2

    2
    4 2 4
    1 2 3
    2 3 4
    7 3 74
    3 6 56
    2 5 56
    3 7 70

    Sample Output 2

    20
    160326468

    Hint


    Source  清华集训2017