This solution won 3d place in first stage and 1st place in second stage 🥉🥇
task: https://t.me/contest/6
result: https://t.me/contest/26
task: https://t.me/contest/59
result: https://contest.com/chart-android/entry25
Used only android sdk and support library, for graph rendering used android.graphics.Canvas, for recalculating graph position used binary search and SegmentTree. 😎