Implement triangle 3 and 4

Fix triangle 3 and 4 judgement is mistaken (just typo)