Making a model predict on the basis of a particular value

I have an input vector of shape say 1 x 400. It’s fed into a network that outputs a 1 x 100 vector. I want to design a model that only considers every 4th value of this tensor and gives me the max values.

For example, a demo tensor could be [0.1, 0.2, 0.4, 3, 0.7, 0.2, 0.6, 8, 0.3, 0.1, 0.5, 12, 0.7, 0.1, 0.9, 8]. For this 1x16 input, the corresponding output would be a 1x4 one. I want the model to look only at values 3,8,12,12 and then predict an output of the following form 0,0,1,1. (note that there could be more than 1 1s in the output)

I have tried using MLPs to do this using CELoss but to no avail. Can this be solved using some particular architecture/loss only or am I doing something wrong?