The Density of the iron nail is greater than the density of water.
The density of water is not really 1 g/ml, but rather a bit less at0.9998395 g/ml at 4.0° Celsius (39.2° Fahrenheit).
As water is warmed from the freezing point of 0 to 4 °C. It contracts and becomes denser. This initial increase in density takes place because at 0°C a portion of the water consists of open-structured molecular arrangements similar to those of ice crystals.
Ice is less dense than water.
The cork's density is 0.24 g/cm3, and the density of water is 1.00 g/cm3. So the cork will float.