How to copy object's dimension from another object?

I am learning Blender and just stuck on one thing. I have two Objects (A and B), A's length is 400 and B's length is 100. I want to make B's length half of A's length. like whenever I change A's length, B's length should automatically get change to its half. But I don't want to do it with python script. is there any way to put some simple code/defination/name in Blender's UI, where we manually enter object's length (under Dimensions - after clicking 'N' after selecting the object)