How to distribution count between rows SQL Server


How to retrieve output with example :

CREATE TABLE yourTable 
(
     id varchar(55), 
     code int,
     count1 int,
     count2 int
);

INSERT INTO yourTable (id, code,count1,count2)
VALUES
    ('no-29', 12345, 4, 1),
    ('no-29', 32346, 4, 1)

always count1-count2 and results distribution between others rows with same id:
example : 4-1 = 3 and 3 distribution between 12345, 32346

I want too distribution 1,1 and 1,0 order by id,code(because 3 is odd and if even => 1,1 and 1,1 => countdistribute for codes is 2,2 )

Output :

id         code    countdistribute
----------------------------------
'no-29'    12345        2
'no-29'    32346        1