i have used dfs by passing node and multiplyin the cost for each chidren node
why it is getting WA for subtask one??
problem link::link
solution link::link
@gouthamreddy12 you have multiplied the numbers and taken modulo.
But factors of the product can not be equal to the factors of the product mod m for large numbers