Assume you have 100g of the compound.
To find the chemical formula, we need to convert mass to moles, and we can do this using the molar mass of the elements, which is just the atomic mass of the element in grams.
Divide the mass by the molar mass to get moles.
Mole ratio of K:Cr:O is
The formula is thus