Its not easy, first of all you contradicted yourself, one time you require cost to be 3 -> 4, another time 1 -> 2, you can't have both as one use 1.41 another 1.5.
Beside to round up I use integer div, and even more this is used to all rounding in move cost even for horizontal paths, this is why its hard, change to it will change other cases too.