It is 20 m to the object. The photo shows the building environment. It is not important how much the environment will be in the picture, are important dimensions of the output file. ( File dimension: 3m x 20 m in photographic quality (300 dpi)
Those are serious requirements. Let look at it this way, 3m high at 300 PPI equals a 35,433 pixels image height (and 20 m width @ 300 PPI equals 2,362,205 pixels!). The IQ3 100MP has 11608 pixels height in portrait orientation, which would require a minimum of 4 rows with something a bit more than 20% overlap. Alternatively, but that's possibly more work, 5 rows with the camera in landscape orientation. It's usually faster to shoot a single row with more shots than more rows with fewer horizontal shots.
For a natural perspective: FocalLength = SensorWidth x SubjectDistance / SubjectWidth.
In your case it is easier to calculate with height because the height of you subject is easier to estimate, so then the formula becomes: FocalLength = SensorHeight x SubjectDistance / SubjectHeight.
Which for a normal portrait orientation sensor means that,
FocalLength = 53.7 mm x 20 metres / SubjectHeight in metres.
So if you know the vertical height of the subject you are shooting, e.g. 40 metres high (=13-16 floors) at 20 metres distance, the normal focal length would need to be 26.85 mm, but if you shoot in 4 rows, you'd need something like a 100 - 110 mm lens.
For other subject sizes, or for a not natural perspective, the assumptions and the required focal length will obviously change.
This is a bit of an on-a-napkin calculation, because things also depend on the projection used for stichtching, and if people come as close as reading distance, the perspective will also change and you might want to use shorter focal lengths which would cover more of a vertical Field of View. It also depends how the shot is made, under which angle it is shot.
Also, depending on the projection used for stitching, you might need more shots in the corners, and thus add rows.
As said by others, once you know the type of focal length needed, it may be easier to choose which one is sharpest (mostly in the center due to overlapping pano tiles).
Cheers,
Bart