In this task you will be given a list of integers. For every element in the list, if the element is even you should divide by two, if the element is odd you should multiply by three then add one. The output should be a list of integers that is the result of applying that logic to the input list.

[62, 40, 81, 165, 147, 137, 143, 2, 58]
[31, 20, 244, 496, 442, 412, 430, 1, 29]

[166, 73]
[83, 220]

[77, 76, 196]

[232, 38, 98]