The given sample inputs are the distance from home to office. This changes for each test case. But the number of working days in a week is constant which is 5.
To find the distance he walked in one day it is :
[ 1 x 2 = 2 kms for test case1 ] and
[ 7 x 2 = 14 kms for test case 2 ]
Now, having found the walking distance per day,
we have to calculate for 5 days, then:
[2 x 5 =10 kms for test case1]
[14 x 5 = 70 kms for test case 2]