You may read the problem description here. I have a main in main.cpp.

Like many topcoder problems, this is an unweighted shortest path problem, with a couple of twists. I'm not going to hold your hand through this one, though. You are going to build a graph. You can build it before doing the BFS or while you do the BFS. Each edge is labeled with an operation. Whenever you read a node that is greater than t, you can stop processing that node.

Here is an example of the graph that you would build when s is 7 and t is 392, were you to build the graph before doing the BFS. Whenever I create a node whose value is greater than 392, I stop processing that node.

It should be pretty easy to see how this graph generates "+*+". It should also be clear how it generates "/+***" in example 1. There are some details, however, that you'll have to iron out:

Have fun!