#include <stdio.h>
#include <stdint.h>
uint16_t pack_register(uint8_t mode, uint8_t speed, uint8_t status) {
// Your logic here
union test
{
uint16_t total;
struct
{
uint8_t Mode:3;
uint8_t Speed:5;
uint8_t Reserved:2;
uint8_t Status:6;
};
};
test k;
k.Mode = mode;
k.Speed = speed;
k.Reserved = 0;
k.Status = status;
return k.total;
}
int main() {
uint8_t mode, speed, status;
scanf("%hhu %hhu %hhu", &mode, &speed, &status);
uint16_t reg = pack_register(mode, speed, status);
printf("%u", reg);
return 0;
}