Question: I am trying to reproduce this logic but using material-ui useStyle

```
<div className={'container ' + (state.unlocked ? 'containerUnlocked' : '')}>  

```

I imagined it would be something similar to this :

```
<div className={`${classes.container} + ${state.unlocked} ? ${classes.spacious} : ''`}>  

```

But it doesn't work.

Answer: 
I assume that efficiency is not a concern here, that it is just for fun (or a homework?).

As explained already, you cannot divide by 10 with bit shifting as easily as you can multiply by 10.

However, It is quite possible to use bit shifting for such a division, except that more shiftings are necessary.

For example, we can use the fact that `1/10 = 1/8 - 1/10 (1/4)`

Output:

```
3/10 = 0
12/10 = 1
128/10 = 13
1465/10 = 147
4566/10 = 457
5674/10 = 567

```

```
#include <stdio.h>
int div10 (int n) {
    if (n == 0) return 0;
    return (n >> 3) - div10(n >> 2);
}

int main () {
    int nums[] = {3, 12, 128, 1465, 4566, 5674};
    int n = sizeof(nums)/ sizeof(nums[0]);
    for (int i = 0; i < n; ++i) {
        int num = nums[i];
        int ans = div10(num);
        printf ("%d/10 = %d\n", num, ans);
    }
    return 0;
}

```
You've gotten good answers, but allow me to offer another view of this that might be simpler. This was the multiplication:

```
a = 20<<3 
b = 20<<1 
a + b 

```

And you wanted to do division like this:

```
a = 20>>3 
b = 20>>1 
a + b 

```

The problem here is that you only have reversed the individual parts. You need to reverse the whole process. Let's take a simple example from temperatures. If you have a certain temperature `c` in Celsius and want to convert it to Fahrenheit, you do it with this formula:

```
f = 1.8c + 32

```

What you're trying is to convert back to Celsius with the same formula:

```
c = f/1.8 - 32

```

But since the addition was the last step in the original formula, we need to reverse that step **before** we reverse the multiplication. Here is the correct inversion:

```
c = (f-32)/1.8

```