A fly is trapped inside a hollow cube. It moves from A to C along edges of cube, taking shortest possible route. It then comes back to A again along edges, taking longest route(without going over any point more than once). If the total distance traveled is 5040 meter , what is the area of face of the cube in $m^2$ ?
Please check following drawing , you will understand about A & C

If $A$ is adjacent to $C$, then the shortest path is a single edge. The longest path visits all eight vertices, hence is seven edges long. Together that's eight edges; if the total distance is $5040$ meters, then each edges is 630 meters long, which makes each cube's face $630^2=396900$ square meters, and the total cube surface area $2381400$ square meters.
Other cases ($A$ on the same face as $C$ but not adjacent, $A$ opposite from $C$), I leave for you to figure out.
More details as per request: Again, for the case where $A,C$ are adjacent, the longest path is what's called a Hamiltonian path for a cube graph. In fact, there's a Hamiltonian cycle, which returns back to the starting point. The start and end point of the Hamiltonian path are adjacent, so for this case we can take a tour of all the other vertices along the way. For the problem as given (where $A,C$ are on the same face but not adjacent), as @Guest points out you can't visit all the edges on the return trip.