I think it can be solved in this manner,
Partition 1 : 16 MB (Free)
Partition 2 : 16 MB (Free)
Partition 3 : 16 MB (Free)
Partition 4 : 16 MB (Free)
Partition 5 : 16 MB (Free)
Partition 6 : 16 MB (Free)
Partition 7 : 16 MB (Free)
Partition 8 : 16 MB (Free)
Now 12 MB will move to partition 1.
18 MB and 20 MB , doesn't move to any partition because, there sizes are larger
then available free memory.
(Because they required continous block of free memory which is not available)
Partition Used Unused Fragmentation
1 12 4 Internal
2 0 16 External
3 0 16 External
4 0 16 External
5 0 16 External
6 0 16 External
7 0 16 External
8 0 16 External
Hence external fragmentation percentage will be = ((16 * 7)/(16 * 8)) * 100 = 87.5