I tried a question based on geometry and found an O(n) algo but still its getting AC with time limit 1 sec. Please give suggestions to improve my code's efficiency. question: ICPC mirror problem G (https://codeforces.net/contest/1468/problem/G) my Code: https://codeforces.net/contest/1468/submission/102368471 Edit Somehow taking input as integers and then assigning to point data structures solves my issue.