The punishment for a crime is decided on the basis of severance. The more severe manner of commission of crime, the more term of punishment for the crime. If the crime committed is so serious as is likely to create a deterrent effect in the society then the punishment would be maximum.
If it is written : "shall be punished with imprisonment of either descripttion for a term which may extend to five years and shall also be liable to fine". It means the imprisonment would depend upon the discretion of the judge and it will not exceed three years and fine will also be imposed wiith imprisonment (if it is written like "and shal also be liable to fine").
If it is written : "shall be punished with imprisonment of 3 years which may extend to 5 years or may extend to 10 years" then it means imprisonment upto a term of 10 years can be there.
If it is written: "shall be punished with imprisonment of one year or with fine or with both". The court may, on its discretion award sentence of upto one year or fine may be imposed or it is also possible that the court may provide imprisonment and fine both. it is totally the discretion of the judge.