#include <iostream>
#include <algorithm>
using namespace std;

int main() {
	class treasure {
		public:
        std::string name;
        double value;
        double weight;
	};
	treasure item[] = {
		{"rice1", 40, 20},
		{"rice2", 50, 27},
		{"rice3", 35, 24}
	};
	
	std::sort(item, item+3,
    	[] (auto t1, auto t2) {return t1.value < t2.value;});

    std::cout << std::endl << std::endl << "Item name: " << "\t" << "Item value(per kg): " << "\t" << "Item weight(in kg): " << std::endl;
    for (int i = 0; i < 3; i++) {
        std::cout << item[i].name << "\t\t" << item[i].value << "\t\t\t" << item[i].weight << std::endl;
    }
}