Let the initial amount that Sam had be x.
Then, since Rob had twice as much as Sam, Rob's money would be 2x.
Now, Sam gave 1 quarter, 2 nickels and 3 pennies to Rob.
Let's convert all of them into pennies.
1 quarter + 2 nickels + 3 pennies = 25 + (2 x 5) + 3
= 38 pennies
So, Sam's amount is x - 38 and Rob's amount is 2x + 38.
Now, Rob gives 8 dimes to Sam.
8 dimes = 80 pennies.
So, Sam's amount now is x - 38 + 80 = x + 42 and
Rob's amount is 2x + 38 - 80 = 2x - 42
Its given that these two amounts are same.
So, 2x - 42 = x + 42
2x - x = 42 + 42
x = 84
Rob's original amount = 2x = 2(84) = 168 pennies.
= $1 + 6 dimes + 1 nickel + 3 pennies