Sometimes greedy is wrong. How do you find out? Look for small inputs where greedy gives the wrong answer. Strategies:
Test small cases: : Try all inputs of size , , by hand.
Edge cases: : All values equal? All different? Extreme ratios?
Adversarial construction: : Build an input where greedy makes a bad first choice. One counterexample is enough to prove greedy fails. Then you need DP or another technique. Finding a counterexample saves you from submitting a wrong solution.